[IMP]: improvement in invoice

[IMP]: improve in journal items menu
[FIX]: fix a reconcile entries problems in voucher payment

bzr revid: mga@tinyerp.com-20100708142559-3yocywnf984fkcdj
This commit is contained in:
Mantavya Gajjar 2010-07-08 19:55:59 +05:30
parent 977d51f569
commit ee2fabb247
4 changed files with 15 additions and 14 deletions

View File

@ -257,7 +257,7 @@
<field name="number"/>
<field name="type" invisible="1"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change Currency"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" groups="base.group_user"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
@ -490,7 +490,7 @@
<act_window domain="[('account_analytic_id', '=', active_id)]" id="act_account_analytic_account_2_account_invoice_line" name="Invoice lines" res_model="account.invoice.line" src_model="account.analytic.account"/>
<act_window domain="[('partner_id', '=', partner_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_invoice_account_move_unreconciled" name="Unreconciled Receivables &amp; Payables" res_model="account.move.line" src_model="account.invoice"/>
<act_window domain="[('partner_id', '=', partner_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_invoice_account_move_unreconciled" name="Unreconciled Entries" res_model="account.move.line" src_model="account.invoice"/>
</data>
</openerp>

View File

@ -1209,7 +1209,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_line_tree"/>
<field name="search_view_id" ref="view_account_move_line_filter"/>
<field name="domain">[('journal_id.type', 'in', ['sale', 'sale_refund'])]</field>
<field name="domain">[('journal_id.type', 'in', ['sale', 'purchase_refund'])]</field>
</record>
<menuitem action="action_account_moves_sale" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables"/>
@ -1221,7 +1221,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_line_tree"/>
<field name="search_view_id" ref="view_account_move_line_filter"/>
<field name="domain">[('journal_id.type', 'in', ['purchase', 'purchase_refund'])]</field>
<field name="domain">[('journal_id.type', 'in', ['purchase', 'sale_refund'])]</field>
<field name="context">{'journal_id':1}</field>
</record>

View File

@ -234,7 +234,7 @@ class account_invoice(osv.osv):
'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True),
required=True, readonly=True, states={'draft':[('readonly',False)]}),
'comment': fields.text('Additional Information', translate=True),
'state': fields.selection([
@ -312,8 +312,8 @@ class account_invoice(osv.osv):
},
help="Remaining amount due."),
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
'move_name': fields.char('Ledger Posting', size=64),
'user_id': fields.many2one('res.users', 'Salesman'),
'move_name': fields.char('Ledger Posting', size=64, readonly=True, states={'draft':[('readonly',False)]}),
'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
}
_defaults = {
@ -1574,4 +1574,4 @@ class res_partner(osv.osv):
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -143,14 +143,15 @@ class account_voucher(osv.osv):
})
amount = line.amount
if line.invoice_id:
move_line.update({
'invoice_id':line.invoice_id.id
})
invoice_pool.pay_and_reconcile(cr, uid, [line.invoice_id.id], amount, inv.account_id.id, inv.period_id.id, inv.journal_id.id, False, False, False)
move_line_id = move_line_pool.create(cr, uid, move_line)
line_ids += [move_line_id]
if line.invoice_id:
rec_ids = [move_line_id]
for move_line in line.invoice_id.move_id.line_id:
if line.account_id.id == move_line.account_id.id:
rec_ids += [move_line.id]
move_line_pool.reconcile_partial(cr, uid, rec_ids)
rec = {
'move_id': move_id,