Add field local_instrument in payment lines and bank payment lines

This commit is contained in:
Alexis de Lattre
2016-06-05 00:44:27 +02:00
committed by Enric Tobella
parent 63946e09f3
commit 872a34b8d5
4 changed files with 10 additions and 1 deletions

View File

@@ -15,6 +15,10 @@ class AccountPaymentLine(models.Model):
string='Priority', default='NORM',
help="This field will be used as 'Instruction Priority' in "
"the generated PAIN file.")
# local_instrument is used in some countries, for example
# switzerland, cf l10n_ch_sepa that adds some entries in
# the selection field
local_instrument = fields.Selection([], string='Local Instrument')
# PAIN allows 140 characters
communication = fields.Char(size=140)
# The field struct_communication_type has been dropped in v9

View File

@@ -10,10 +10,13 @@ class BankPaymentLine(models.Model):
priority = fields.Selection(
related='payment_line_ids.priority', string='Priority')
local_instrument = fields.Selection(
related='payment_line_ids.local_instrument',
string='Local Instrument')
@api.model
def same_fields_payment_line_and_bank_payment_line(self):
res = super(BankPaymentLine, self).\
same_fields_payment_line_and_bank_payment_line()
res += ['priority']
res += ['priority', 'local_instrument']
return res

View File

@@ -14,6 +14,7 @@
<field name="arch" type="xml">
<field name="communication_type" position="before">
<field name="priority"/>
<field name="local_instrument" invisible="1"/>
</field>
</field>
</record>

View File

@@ -14,6 +14,7 @@
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="priority"/>
<field name="local_instrument" invisible="1"/>
</field>
</field>
</record>