diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index f1e6551bf..22b8d64ae 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -24,3 +24,4 @@ from . import payment_line from . import payment_mode from . import res_company from . import banking_export_pain +from . import res_partner_bank diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 97ba21b8a..d1a178c72 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -229,7 +229,7 @@ class BankingExportPain(orm.AbstractModel): control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum') payment_type_info_2_6 = etree.SubElement( payment_info_2_0, 'PmtTpInf') - if priority: + if priority and gen_args['payment_method'] != 'DD': instruction_priority_2_7 = etree.SubElement( payment_type_info_2_6, 'InstrPrty') instruction_priority_2_7.text = priority diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 0598710e1..872827b7b 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -42,7 +42,8 @@ class PaymentLine(orm.Model): "company. Depicts 'What do you want to say to the recipient " "about this order ?'"), 'struct_communication_type': fields.selection( - _get_struct_communication_types, 'Structured Communication Type'), + '_get_struct_communication_types', + 'Structured Communication Type'), } _defaults = { diff --git a/account_banking_pain_base/models/res_partner_bank.py b/account_banking_pain_base/models/res_partner_bank.py new file mode 100644 index 000000000..3c7a5ff0d --- /dev/null +++ b/account_banking_pain_base/models/res_partner_bank.py @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) ACSONE SA/NV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, fields + + +class ResPartnerBank(models.Model): + _inherit = 'res.partner.bank' + + bank = fields.Many2one(help="If this field is set and the related bank " + "has a 'Bank Identifier Code', then this BIC " + "will be used to generate the credit " + "transfers and direct debits files.") + bank_bic = fields.Char(help="In the generation of credit transfer and " + "direct debit files, this BIC will be used " + "only when the 'Bank' field is empty, or " + "has a value but the field 'Bank Identifier " + "Code' is not set on the related bank.")