Add partner bank on customer invoice

The bank will be use by other module to generate the invoice with electronic payment

bzr revid: ced-4e7373771274e08a5941d8d7eecd82fc7258adc2
This commit is contained in:
ced 2007-12-06 12:14:10 +00:00
parent e809ecd3d5
commit 5fd3d8dd4f
4 changed files with 14 additions and 5 deletions

View File

@ -269,8 +269,8 @@
<newline/>
<field name="date_due" select="1"/>
<newline/>
<field name="reference_type" select="2" nolabel="1" size="0"/>
<field name="reference" select="2" nolabel="1"/>
<field name="partner_bank" select="2"
domain="[('partner_id.ref_companies', 'in', [company_id])]"/>
<field name="origin"/>
<field name="address_contact_id" domain="[('partner_id','=',partner_id)]" colspan="4"/>
<field name="move_id"/>

View File

@ -150,7 +150,7 @@ class account_invoice(osv.osv):
'check_total': fields.float('Total', digits=(16,2), states={'open':[('readonly',True)],'close':[('readonly',True)]}),
'reconciled': fields.function(_reconciled, method=True, string='Reconciled', type='boolean'),
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
help='The partner bank account to pay\nKeep empty to use the default'),
help='The bank account to pay or to be paid'),
}
_defaults = {
'type': _get_type,
@ -209,10 +209,12 @@ class account_invoice(osv.osv):
'address_invoice_id': invoice_addr_id,
'account_id': acc_id,
'payment_term': partner_payment_term,
'partner_bank': bank_id,
}
}
if type in ('in_invoice', 'in_refund'):
result['value']['partner_bank'] = bank_id
if payment_term != partner_payment_term:
if partner_payment_term:
to_update = self.onchange_payment_term_date_invoice(

View File

@ -116,6 +116,8 @@ class res_partner(osv.osv):
view_load=True,
group_name="Accounting Properties",
help="This payment term will be used, instead of the default one, for the current partner"),
'ref_companies': fields.one2many('res.company', 'partner_id',
'Companies that refers to partner'),
}
res_partner()

View File

@ -34,5 +34,10 @@ class account_invoice(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.account.invoice', 'account.invoice', 'addons/account/report/invoice.rml', parser=account_invoice)
report_sxw.report_sxw(
'report.account.invoice',
'account.invoice',
'addons/account/report/invoice.rml',
parser=account_invoice,
)