From dc556a41d53f51d0b627f6ac19378d622a375eb1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 22 Nov 2013 00:41:32 +0100 Subject: [PATCH 01/79] Akretion-Noviat code sprint dated 2013-11-21: - add module account_banking_pain_base - add support for initiating party identification, priority and structured remittance info in XML file - the requested execution date now uses the fields date_prefered and date_scheduled (the field of the wizard has been removed) - the 'convert to ascii' feature is now an option of the payment mode (enabled by default) - set 'communication' field of payment.line to 140 chars and hide field 'communicatio n2' --- account_banking_pain_base/__init__.py | 25 +++++++++ account_banking_pain_base/__openerp__.py | 47 ++++++++++++++++ account_banking_pain_base/company.py | 53 +++++++++++++++++++ account_banking_pain_base/company_view.xml | 24 +++++++++ account_banking_pain_base/payment_line.py | 49 +++++++++++++++++ .../payment_line_view.xml | 41 ++++++++++++++ account_banking_pain_base/payment_mode.py | 37 +++++++++++++ .../payment_mode_view.xml | 22 ++++++++ 8 files changed, 298 insertions(+) create mode 100644 account_banking_pain_base/__init__.py create mode 100644 account_banking_pain_base/__openerp__.py create mode 100644 account_banking_pain_base/company.py create mode 100644 account_banking_pain_base/company_view.xml create mode 100644 account_banking_pain_base/payment_line.py create mode 100644 account_banking_pain_base/payment_line_view.xml create mode 100644 account_banking_pain_base/payment_mode.py create mode 100644 account_banking_pain_base/payment_mode_view.xml diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py new file mode 100644 index 000000000..a54725775 --- /dev/null +++ b/account_banking_pain_base/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . import payment_line +from . import payment_mode +from . import company diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py new file mode 100644 index 000000000..8a66aaafa --- /dev/null +++ b/account_banking_pain_base/__openerp__.py @@ -0,0 +1,47 @@ +############################################################################## +# +# PAIN base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## +{ + 'name': 'Account Banking PAIN Base Module', + 'summary': 'Base module for PAIN file generation', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Akretion, Noviat', + 'website': 'http://openerp-community-association.org/', + 'category': 'Hidden', + 'depends': ['account_banking_payment_export'], + 'data': [ + 'payment_line_view.xml', + 'payment_mode_view.xml', + 'company_view.xml', + ], + 'description': ''' +Base module for PAIN file generation +==================================== + +This module contains fields and functions that are used by the module for SEPA Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit (account_banking_sepa_direct_debit). This module doesn't provide any functionnality by itself. + +This module is part of the banking addons: https://launchpad.net/banking-addons + +This module was developped during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France). + ''', + 'active': False, + 'installable': True, +} diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py new file mode 100644 index 000000000..b40f64440 --- /dev/null +++ b/account_banking_pain_base/company.py @@ -0,0 +1,53 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Copyright (C) 2013 Noviat (http://www.noviat.com) +# @author: Alexis de Lattre +# @author: Luc de Meyer (Noviat) +# +# 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.osv import orm, fields + + +class res_company(orm.Model): + _inherit = 'res.company' + + _columns = { + 'initiating_party_issuer': fields.char( + 'Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP."), + } + + def _get_initiating_party_identifier( + self, cr, uid, company_id, context=None): + '''This function is designed to be inherited by localization modules''' + assert isinstance(company_id, int), 'Only one company ID' + return False + + def _initiating_party_issuer_default(self, cr, uid, context=None): + '''This function is designed to be inherited by localization modules''' + return '' + + def _initiating_party_issuer_def(self, cr, uid, context=None): + return self._initiating_party_issuer_default( + cr, uid, context=context) + + _defaults = { + 'initiating_party_issuer': _initiating_party_issuer_def, + } diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml new file mode 100644 index 000000000..a98d9b641 --- /dev/null +++ b/account_banking_pain_base/company_view.xml @@ -0,0 +1,24 @@ + + + + + + + pain.group.on.res.company.form + res.company + + + + + + + + + + + + diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py new file mode 100644 index 000000000..11d597e4d --- /dev/null +++ b/account_banking_pain_base/payment_line.py @@ -0,0 +1,49 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_line(orm.Model): + _inherit = 'payment.line' + + def _get_struct_communication_types(self, cr, uid, context=None): + return [('ISO', 'ISO')] + + _columns = { + 'priority': fields.selection([ + ('NORM', 'Normal'), + ('HIGH', 'High'), + ], 'Priority', + help="This field will be used as the 'Instruction Priority' in the generated PAIN files."), + # Update size from 64 to 140, because PAIN allows 140 caracters + 'communication': fields.char( + 'Communication', size=140, required=True, + help="Used as the message between ordering customer and current 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'), + } + + _defaults = { + 'priority': 'NORM', + 'struct_communication_type': 'ISO', + } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml new file mode 100644 index 000000000..ea0005faf --- /dev/null +++ b/account_banking_pain_base/payment_line_view.xml @@ -0,0 +1,41 @@ + + + + + + + pain.base.payment.line.form + payment.line + + + + + + + + + + + + + + pain.base.payment.line.inside.order.form + payment.order + + + + + + + + + + + + + + diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py new file mode 100644 index 000000000..7113ccc78 --- /dev/null +++ b/account_banking_pain_base/payment_mode.py @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_mode(orm.Model): + _inherit = 'payment.mode' + + _columns = { + 'convert_to_ascii': fields.boolean( + 'Convert to ASCII', + help="If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file."), + } + + _defaults = { + 'convert_to_ascii': True, + } diff --git a/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/payment_mode_view.xml new file mode 100644 index 000000000..2deb24999 --- /dev/null +++ b/account_banking_pain_base/payment_mode_view.xml @@ -0,0 +1,22 @@ + + + + + + + add.convert_to_ascii.in.payment.mode.form + payment.mode + + + + + + + + + + From 77ac6b31286673d741f53db229cc4d1e501f6faa Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 12 Dec 2013 14:47:01 +0100 Subject: [PATCH 02/79] Start code factoring between SCT and SDD. --- account_banking_pain_base/__init__.py | 1 + account_banking_pain_base/__openerp__.py | 3 + .../banking_export_pain.py | 186 ++++++++++++++++++ account_banking_pain_base/company.py | 5 +- 4 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 account_banking_pain_base/banking_export_pain.py diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index a54725775..6662843e6 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -23,3 +23,4 @@ from . import payment_line from . import payment_mode from . import company +from . import banking_export_pain diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 8a66aaafa..5d461865e 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -27,6 +27,9 @@ 'website': 'http://openerp-community-association.org/', 'category': 'Hidden', 'depends': ['account_banking_payment_export'], + 'external_dependencies': { + 'python': ['unidecode', 'lxml'], + }, 'data': [ 'payment_line_view.xml', 'payment_mode_view.xml', diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py new file mode 100644 index 000000000..6f84033a8 --- /dev/null +++ b/account_banking_pain_base/banking_export_pain.py @@ -0,0 +1,186 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm +from openerp.tools.translate import _ +from openerp.tools.safe_eval import safe_eval +from unidecode import unidecode +from lxml import etree +from openerp import tools +import logging + +logger = logging.getLogger(__name__) + + +class banking_export_pain(orm.AbstractModel): + _name = 'banking.export.pain' + + def _validate_iban(self, cr, uid, iban, context=None): + '''if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message''' + partner_bank_obj = self.pool.get('res.partner.bank') + if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): + return iban.replace(' ', '') + else: + raise orm.except_orm( + _('Error:'), _("This IBAN is not valid : %s") % iban) + + def _prepare_field( + self, cr, uid, field_name, field_value, eval_ctx, max_size=0, + convert_to_ascii=False, context=None): + '''This function is designed to be inherited !''' + assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' + try: + value = safe_eval(field_value, eval_ctx) + # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters + # But we are dealing with banks... + # and many banks don't want non-ASCCI characters ! + # cf section 1.4 "Character set" of the SEPA Credit Transfer + # Scheme Customer-to-bank guidelines + if convert_to_ascii: + value = unidecode(value) + except: + line = eval_ctx.get('line') + if line: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'.") + % (field_name, self.pool['account.invoice'].name_get( + cr, uid, [line.ml_inv_ref.id], context=context)[0][1])) + else: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s'.") % field_name) + if not isinstance(value, (str, unicode)): + raise orm.except_orm( + _('Field type error:'), + _("The type of the field '%s' is %s. It should be a string or unicode.") + % (field_name, type(value))) + if not value: + raise orm.except_orm( + _('Error:'), + _("The '%s' is empty or 0. It should have a non-null value.") + % field_name) + if max_size and len(value) > max_size: + value = value[0:max_size] + return value + + def _validate_xml(self, cr, uid, xml_string, pain_xsd_file): + xsd_etree_obj = etree.parse( + tools.file_open(pain_xsd_file)) + official_pain_schema = etree.XMLSchema(xsd_etree_obj) + + try: + root_to_validate = etree.fromstring(xml_string) + official_pain_schema.assertValid(root_to_validate) + except Exception, e: + logger.warning( + "The XML file is invalid against the XML Schema Definition") + logger.warning(xml_string) + logger.warning(e) + raise orm.except_orm( + _('Error:'), + _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s') + % str(e)) + return True + + def generate_initiating_party_block( + self, cr, uid, parent_node, sepa_export, gen_args, + context=None): + my_company_name = self._prepare_field( + cr, uid, 'Company Name', + 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', + {'sepa_export': sepa_export}, gen_args.get('name_maxsize'), + convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party_name.text = my_company_name + initiating_party_identifier = self.pool['res.company'].\ + _get_initiating_party_identifier( + cr, uid, sepa_export.payment_order_ids[0].company_id.id, + context=context) + initiating_party_issuer = \ + sepa_export.payment_order_ids[0].company_id.initiating_party_issuer + if initiating_party_identifier and initiating_party_issuer: + iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') + iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') + iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') + iniparty_org_other_id.text = initiating_party_identifier + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer + return True + + def generate_party_bic( + self, cr, uid, parent_node, party_type, party_type_label, bic, + eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD''' + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = self._prepare_field( + cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, + convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + return True + + def generate_party_block( + self, cr, uid, parent_node, party_type, order, name, iban, bic, + eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if party_type == 'Cdtr': + party_type_label = 'Creditor' + elif party_type == 'Dbtr': + party_type_label = 'Debtor' + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'C': + self.generate_party_bic( + cr, uid, parent_node, party_type, party_type_label, bic, + eval_ctx, gen_args, context=context) + party = etree.SubElement(parent_node, party_type) + party_name = etree.SubElement(party, 'Nm') + party_name.text = self._prepare_field( + cr, uid, '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), + convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + piban = self._prepare_field( + cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, + convert_to_ascii=gen_args.get('convert_to_ascii'), + context=context) + viban = self._validate_iban(cr, uid, piban, context=context) + party_account_iban.text = viban + if order == 'B': + self.generate_party_bic( + cr, uid, parent_node, party_type, party_type_label, bic, + eval_ctx, gen_args, context=context) + return True diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index b40f64440..c11c13d9b 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -38,7 +38,10 @@ class res_company(orm.Model): self, cr, uid, company_id, context=None): '''This function is designed to be inherited by localization modules''' assert isinstance(company_id, int), 'Only one company ID' - return False + # TODO REMOOOOOOOOOOOOOOOOOOOVE BEFORE COMMIT + + return self.browse(cr, uid, company_id).partner_id.vat + #return False def _initiating_party_issuer_default(self, cr, uid, context=None): '''This function is designed to be inherited by localization modules''' From 4f5a2d3748cf5fb1c546617cffce7c3a2368a5bb Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 12 Dec 2013 22:46:16 +0100 Subject: [PATCH 03/79] More code factoring between SCT and SDD As a consequence, we now have support for structured remittance info in SDD. --- .../banking_export_pain.py | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 6f84033a8..334c106c2 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -23,6 +23,7 @@ from openerp.osv import orm from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval +from datetime import datetime from unidecode import unidecode from lxml import etree from openerp import tools @@ -103,6 +104,36 @@ class banking_export_pain(orm.AbstractModel): % str(e)) return True + def generate_group_header_block( + self, cr, uid, parent_node, sepa_export, gen_args, context=None): + group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') + message_identification_1_1 = etree.SubElement( + group_header_1_0, 'MsgId') + message_identification_1_1.text = self._prepare_field( + cr, uid, 'Message Identification', + 'sepa_export.payment_order_ids[0].reference', + {'sepa_export': sepa_export}, 35, + convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') + creation_date_time_1_2.text = datetime.strftime( + datetime.today(), '%Y-%m-%dT%H:%M:%S') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + # batch_booking is in "Group header" with pain.001.001.02 + # and in "Payment info" in pain.001.001.03/04 + batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking.text = str(sepa_export.batch_booking).lower() + nb_of_transactions_1_6 = etree.SubElement( + group_header_1_0, 'NbOfTxs') + control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + # Grpg removed in pain.001.001.03 + if gen_args.get('pain_flavor') == 'pain.001.001.02': + grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping.text = 'GRPD' + self.generate_initiating_party_block( + cr, uid, group_header_1_0, sepa_export, gen_args, + context=context) + return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + def generate_initiating_party_block( self, cr, uid, parent_node, sepa_export, gen_args, context=None): @@ -184,3 +215,59 @@ class banking_export_pain(orm.AbstractModel): cr, uid, parent_node, party_type, party_type_label, bic, eval_ctx, gen_args, context=context) return True + + def generate_remittance_info_block( + self, cr, uid, parent_node, line, gen_args, context=None): + + remittance_info_2_91 = etree.SubElement( + parent_node, 'RmtInf') + if line.state == 'normal': + remittance_info_unstructured_2_99 = etree.SubElement( + remittance_info_2_91, 'Ustrd') + remittance_info_unstructured_2_99.text = \ + self._prepare_field( + cr, uid, 'Remittance Unstructured Information', + 'line.communication', {'line': line}, 140, + convert_to_ascii=gen_args.get('convert_to_ascii'), + context=context) + else: + if not line.struct_communication_type: + raise orm.except_orm( + _('Error:'), + _("Missing 'Structured Communication Type' on payment line with your reference '%s'.") + % (line.name)) + remittance_info_unstructured_2_100 = etree.SubElement( + remittance_info_2_91, 'Strd') + creditor_ref_information_2_120 = etree.SubElement( + remittance_info_unstructured_2_100, 'CdtrRefInf') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRefTp') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_2_121, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRef') + else: + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'Tp') + creditor_ref_info_type_or_2_122 = etree.SubElement( + creditor_ref_info_type_2_121, 'CdOrPrtry') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_or_2_122, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'Ref') + + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125.text = \ + line.struct_communication_type + creditor_reference_2_126.text = \ + self._prepare_field( + cr, uid, 'Creditor Structured Reference', + 'line.communication', {'line': line}, 35, + convert_to_ascii=gen_args.get('convert_to_ascii'), + context=context) + return True From 88d38292f328f7d773d06e658a31cf5b91fb955a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 13 Dec 2013 00:40:45 +0100 Subject: [PATCH 04/79] Add support for direct debit migration from national format to SEPA Source : Standard-XML-SDD-Initiation-v3-EN by Febelfin --- .../banking_export_pain.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 334c106c2..ffabe82dc 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -271,3 +271,20 @@ class banking_export_pain(orm.AbstractModel): convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) return True + + def generate_creditor_scheme_identification( + self, cr, uid, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args, context=None): + csi_id = etree.SubElement( + parent_node, 'Id') + csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_other = etree.SubElement(csi_privateid, 'Othr') + csi_other_id = etree.SubElement(csi_other, 'Id') + csi_other_id.text = self._prepare_field( + cr, uid, identification_label, identification, eval_ctx, + convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') + csi_scheme_name_proprietary = etree.SubElement( + csi_scheme_name, 'Prtry') + csi_scheme_name_proprietary.text = scheme_name_proprietary + return True From ebce71569dca0582c42af61323254001f9846f05 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 16 Dec 2013 00:46:50 +0100 Subject: [PATCH 05/79] Add group in order to mask the fields for "Original Mandate Indentification" for user s in countries that don't required it. Add tracking on important fields of the mandate. Better form view on company. Update constraint on mandate following my devs on "Original Mandate Identification". --- account_banking_pain_base/company.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index c11c13d9b..b40f64440 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -38,10 +38,7 @@ class res_company(orm.Model): self, cr, uid, company_id, context=None): '''This function is designed to be inherited by localization modules''' assert isinstance(company_id, int), 'Only one company ID' - # TODO REMOOOOOOOOOOOOOOOOOOOVE BEFORE COMMIT - - return self.browse(cr, uid, company_id).partner_id.vat - #return False + return False def _initiating_party_issuer_default(self, cr, uid, context=None): '''This function is designed to be inherited by localization modules''' From 41ca5e18a974fb0f0b01c072ce899714965f57d8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 16 Dec 2013 15:36:42 +0100 Subject: [PATCH 06/79] Add support for Party Identifier for Belgium. Can be easily extended for other countries. --- account_banking_pain_base/company.py | 32 ++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index b40f64440..31c709fb5 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -36,13 +36,37 @@ class res_company(orm.Model): def _get_initiating_party_identifier( self, cr, uid, company_id, context=None): - '''This function is designed to be inherited by localization modules''' + '''The code here may be different from one country to another. + If you need to add support for an additionnal country, you can + contribute your code here or inherit this function in the + localization modules for your country''' assert isinstance(company_id, int), 'Only one company ID' - return False + company = self.browse(cr, uid, company_id, context=context) + company_vat = company.vat + party_identifier = False + if company_vat and company_vat[0:2].upper() in ['BE']: + party_identifier = company_vat[2:].replace(' ', '') + return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): - '''This function is designed to be inherited by localization modules''' - return '' + '''If you need to add support for an additionnal country, you can + add an entry in the dict "party_issuer_per_country" here + or inherit this function in the localization modules for + your country''' + initiating_party_issuer = '' + # If your country require the 'Initiating Party Issuer', you should + # contribute the entry for your country in the dict below + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + company_id = self._company_default_get( + cr, uid, 'res.company', context=context) + if company_id: + company = self.browse(cr, uid, company_id, context=context) + country_code = company.country_id.code + initiating_party_issuer = party_issuer_per_country.get( + country_code, '') + return initiating_party_issuer def _initiating_party_issuer_def(self, cr, uid, context=None): return self._initiating_party_issuer_default( From 3908266d28b9606276279792654ca818c3a72da8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 20 Dec 2013 14:13:20 +0100 Subject: [PATCH 07/79] Mutualize more code between SCT and SDD. --- .../banking_export_pain.py | 92 +++++++++++++++++-- 1 file changed, 82 insertions(+), 10 deletions(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index ffabe82dc..28edd97a0 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -28,6 +28,7 @@ from unidecode import unidecode from lxml import etree from openerp import tools import logging +import base64 logger = logging.getLogger(__name__) @@ -47,8 +48,10 @@ class banking_export_pain(orm.AbstractModel): def _prepare_field( self, cr, uid, field_name, field_value, eval_ctx, max_size=0, - convert_to_ascii=False, context=None): + gen_args=None, context=None): '''This function is designed to be inherited !''' + if gen_args is None: + gen_args = {} assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' try: value = safe_eval(field_value, eval_ctx) @@ -57,7 +60,7 @@ class banking_export_pain(orm.AbstractModel): # and many banks don't want non-ASCCI characters ! # cf section 1.4 "Character set" of the SEPA Credit Transfer # Scheme Customer-to-bank guidelines - if convert_to_ascii: + if gen_args.get('convert_to_ascii'): value = unidecode(value) except: line = eval_ctx.get('line') @@ -85,6 +88,20 @@ class banking_export_pain(orm.AbstractModel): value = value[0:max_size] return value + def _prepare_export_sepa( + self, cr, uid, sepa_export, total_amount, transactions_count, + xml_string, gen_args, context=None): + return { + 'batch_booking': sepa_export.batch_booking, + 'charge_bearer': sepa_export.charge_bearer, + 'total_amount': total_amount, + 'nb_transactions': transactions_count, + 'file': base64.encodestring(xml_string), + 'payment_order_ids': [ + (6, 0, [x.id for x in sepa_export.payment_order_ids]) + ], + } + def _validate_xml(self, cr, uid, xml_string, pain_xsd_file): xsd_etree_obj = etree.parse( tools.file_open(pain_xsd_file)) @@ -113,7 +130,7 @@ class banking_export_pain(orm.AbstractModel): cr, uid, 'Message Identification', 'sepa_export.payment_order_ids[0].reference', {'sepa_export': sepa_export}, 35, - convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + gen_args=gen_args, context=context) creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') creation_date_time_1_2.text = datetime.strftime( datetime.today(), '%Y-%m-%dT%H:%M:%S') @@ -134,6 +151,61 @@ class banking_export_pain(orm.AbstractModel): context=context) return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + def generate_start_payment_info_block( + self, cr, uid, parent_node, sepa_export, payment_info_ident, + priority, local_instrument, sequence_type, requested_date, + eval_ctx, gen_args, context=None): + payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification_2_1 = etree.SubElement( + payment_info_2_0, 'PmtInfId') + payment_info_identification_2_1.text = self._prepare_field( + cr, uid, 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, + gen_args=gen_args, context=context) + payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') + if gen_args.get('pain_flavor').startswith('pain.008.'): + payment_method_2_2.text = 'DD' + request_date_tag = 'ReqdColltnDt' + else: + payment_method_2_2.text = 'TRF' + request_date_tag = 'ReqdExctnDt' + if gen_args.get('pain_flavor') != 'pain.001.001.02': + batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') + batch_booking_2_3.text = str(sepa_export.batch_booking).lower() + # The "SEPA Customer-to-bank + # Implementation guidelines" for SCT and SDD says that control sum + # and nb_of_transactions should be present + # at both "group header" level and "payment info" level + nb_of_transactions_2_4 = etree.SubElement( + payment_info_2_0, 'NbOfTxs') + 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: + instruction_priority_2_7 = etree.SubElement( + payment_type_info_2_6, 'InstrPrty') + instruction_priority_2_7.text = priority + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' + if local_instrument: + local_instrument_2_11 = etree.SubElement( + payment_type_info_2_6, 'LclInstrm') + local_instr_code_2_12 = etree.SubElement( + local_instrument_2_11, 'Cd') + local_instr_code_2_12.text = local_instrument + if sequence_type: + sequence_type_2_14 = etree.SubElement( + payment_type_info_2_6, 'SeqTp') + sequence_type_2_14.text = sequence_type + + requested_date_2_17 = etree.SubElement( + payment_info_2_0, request_date_tag) + requested_date_2_17.text = requested_date + return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + + def generate_initiating_party_block( self, cr, uid, parent_node, sepa_export, gen_args, context=None): @@ -141,7 +213,7 @@ class banking_export_pain(orm.AbstractModel): cr, uid, 'Company Name', 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', {'sepa_export': sepa_export}, gen_args.get('name_maxsize'), - convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + gen_args=gen_args, context=context) initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name @@ -174,7 +246,7 @@ class banking_export_pain(orm.AbstractModel): party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = self._prepare_field( cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, - convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + gen_args=gen_args, context=context) return True def generate_party_block( @@ -198,7 +270,7 @@ class banking_export_pain(orm.AbstractModel): party_name.text = self._prepare_field( cr, uid, '%s Name' % party_type_label, name, eval_ctx, gen_args.get('name_maxsize'), - convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + gen_args=gen_args, context=context) party_account = etree.SubElement( parent_node, '%sAcct' % party_type) party_account_id = etree.SubElement(party_account, 'Id') @@ -206,7 +278,7 @@ class banking_export_pain(orm.AbstractModel): party_account_id, 'IBAN') piban = self._prepare_field( cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, - convert_to_ascii=gen_args.get('convert_to_ascii'), + gen_args=gen_args, context=context) viban = self._validate_iban(cr, uid, piban, context=context) party_account_iban.text = viban @@ -228,7 +300,7 @@ class banking_export_pain(orm.AbstractModel): self._prepare_field( cr, uid, 'Remittance Unstructured Information', 'line.communication', {'line': line}, 140, - convert_to_ascii=gen_args.get('convert_to_ascii'), + gen_args=gen_args, context=context) else: if not line.struct_communication_type: @@ -268,7 +340,7 @@ class banking_export_pain(orm.AbstractModel): self._prepare_field( cr, uid, 'Creditor Structured Reference', 'line.communication', {'line': line}, 35, - convert_to_ascii=gen_args.get('convert_to_ascii'), + gen_args=gen_args, context=context) return True @@ -282,7 +354,7 @@ class banking_export_pain(orm.AbstractModel): csi_other_id = etree.SubElement(csi_other, 'Id') csi_other_id.text = self._prepare_field( cr, uid, identification_label, identification, eval_ctx, - convert_to_ascii=gen_args.get('convert_to_ascii'), context=context) + gen_args=gen_args, context=context) csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') csi_scheme_name_proprietary = etree.SubElement( csi_scheme_name, 'Prtry') From 3de24ccda2786c42f0c7cd293744cf181e878019 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 24 Dec 2013 01:01:04 +0100 Subject: [PATCH 08/79] Replace unallowed ascii caracters by '-' Update some error messages Update translation files and FR translation Include sepa_export in gen_args Factorize more code between SDD and SCT Fix view of payment lines The modules account_banking_pain_base and account_banking_sepa_* are now fully PEP8 compliant --- .../banking_export_pain.py | 105 +++++++++---- account_banking_pain_base/company.py | 3 +- .../i18n/account_banking_pain_base.pot | 146 ++++++++++++++++++ account_banking_pain_base/i18n/fr.po | 146 ++++++++++++++++++ account_banking_pain_base/payment_line.py | 7 +- .../payment_line_view.xml | 6 +- account_banking_pain_base/payment_mode.py | 4 +- 7 files changed, 382 insertions(+), 35 deletions(-) create mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot create mode 100644 account_banking_pain_base/i18n/fr.po diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 28edd97a0..30a1d5474 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -62,14 +62,19 @@ class banking_export_pain(orm.AbstractModel): # Scheme Customer-to-bank guidelines if gen_args.get('convert_to_ascii'): value = unidecode(value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') except: line = eval_ctx.get('line') if line: raise orm.except_orm( _('Error:'), - _("Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'.") - % (field_name, self.pool['account.invoice'].name_get( - cr, uid, [line.ml_inv_ref.id], context=context)[0][1])) + _("Cannot compute the '%s' of the Payment Line with " + "reference '%s'.") + % (field_name, line.name)) else: raise orm.except_orm( _('Error:'), @@ -77,7 +82,8 @@ class banking_export_pain(orm.AbstractModel): if not isinstance(value, (str, unicode)): raise orm.except_orm( _('Field type error:'), - _("The type of the field '%s' is %s. It should be a string or unicode.") + _("The type of the field '%s' is %s. It should be a string " + "or unicode.") % (field_name, type(value))) if not value: raise orm.except_orm( @@ -89,22 +95,22 @@ class banking_export_pain(orm.AbstractModel): return value def _prepare_export_sepa( - self, cr, uid, sepa_export, total_amount, transactions_count, - xml_string, gen_args, context=None): + self, cr, uid, total_amount, transactions_count, xml_string, + gen_args, context=None): return { - 'batch_booking': sepa_export.batch_booking, - 'charge_bearer': sepa_export.charge_bearer, + 'batch_booking': gen_args['sepa_export'].batch_booking, + 'charge_bearer': gen_args['sepa_export'].charge_bearer, 'total_amount': total_amount, 'nb_transactions': transactions_count, 'file': base64.encodestring(xml_string), - 'payment_order_ids': [ - (6, 0, [x.id for x in sepa_export.payment_order_ids]) - ], + 'payment_order_ids': [( + 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] + )], } - def _validate_xml(self, cr, uid, xml_string, pain_xsd_file): + def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): xsd_etree_obj = etree.parse( - tools.file_open(pain_xsd_file)) + tools.file_open(gen_args['pain_xsd_file'])) official_pain_schema = etree.XMLSchema(xsd_etree_obj) try: @@ -117,19 +123,58 @@ class banking_export_pain(orm.AbstractModel): logger.warning(e) raise orm.except_orm( _('Error:'), - _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s') + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. Here " + "is the error, which may give you an idea on the cause " + "of the problem : %s") % str(e)) return True + def finalize_sepa_file_creation( + self, cr, uid, ids, xml_root, total_amount, transactions_count, + gen_args, context=None): + xml_string = etree.tostring( + xml_root, pretty_print=True, encoding='UTF-8', + xml_declaration=True) + logger.debug( + "Generated SEPA XML file in format %s below" + % gen_args['pain_flavor']) + logger.debug(xml_string) + self._validate_xml(cr, uid, xml_string, gen_args, context=context) + + file_id = gen_args['file_obj'].create( + cr, uid, self._prepare_export_sepa( + cr, uid, total_amount, transactions_count, + xml_string, gen_args, context=context), + context=context) + + self.write( + cr, uid, ids, { + 'file_id': file_id, + 'state': 'finish', + }, context=context) + + action = { + 'name': 'SEPA File', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': self._name, + 'res_id': ids[0], + 'target': 'new', + } + return action + def generate_group_header_block( - self, cr, uid, parent_node, sepa_export, gen_args, context=None): + self, cr, uid, parent_node, gen_args, context=None): group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') message_identification_1_1 = etree.SubElement( group_header_1_0, 'MsgId') message_identification_1_1.text = self._prepare_field( cr, uid, 'Message Identification', 'sepa_export.payment_order_ids[0].reference', - {'sepa_export': sepa_export}, 35, + {'sepa_export': gen_args['sepa_export']}, 35, gen_args=gen_args, context=context) creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') creation_date_time_1_2.text = datetime.strftime( @@ -138,7 +183,8 @@ class banking_export_pain(orm.AbstractModel): # batch_booking is in "Group header" with pain.001.001.02 # and in "Payment info" in pain.001.001.03/04 batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') - batch_booking.text = str(sepa_export.batch_booking).lower() + batch_booking.text = \ + str(gen_args['sepa_export'].batch_booking).lower() nb_of_transactions_1_6 = etree.SubElement( group_header_1_0, 'NbOfTxs') control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') @@ -147,12 +193,12 @@ class banking_export_pain(orm.AbstractModel): grouping = etree.SubElement(group_header_1_0, 'Grpg') grouping.text = 'GRPD' self.generate_initiating_party_block( - cr, uid, group_header_1_0, sepa_export, gen_args, + cr, uid, group_header_1_0, gen_args, context=context) return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 def generate_start_payment_info_block( - self, cr, uid, parent_node, sepa_export, payment_info_ident, + self, cr, uid, parent_node, payment_info_ident, priority, local_instrument, sequence_type, requested_date, eval_ctx, gen_args, context=None): payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') @@ -171,7 +217,8 @@ class banking_export_pain(orm.AbstractModel): request_date_tag = 'ReqdExctnDt' if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = str(sepa_export.batch_booking).lower() + batch_booking_2_3.text = \ + str(gen_args['sepa_export'].batch_booking).lower() # The "SEPA Customer-to-bank # Implementation guidelines" for SCT and SDD says that control sum # and nb_of_transactions should be present @@ -205,24 +252,23 @@ class banking_export_pain(orm.AbstractModel): requested_date_2_17.text = requested_date return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 - def generate_initiating_party_block( - self, cr, uid, parent_node, sepa_export, gen_args, - context=None): + self, cr, uid, parent_node, gen_args, context=None): my_company_name = self._prepare_field( cr, uid, 'Company Name', 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', - {'sepa_export': sepa_export}, gen_args.get('name_maxsize'), - gen_args=gen_args, context=context) + {'sepa_export': gen_args['sepa_export']}, + gen_args.get('name_maxsize'), gen_args=gen_args, context=context) initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name initiating_party_identifier = self.pool['res.company'].\ _get_initiating_party_identifier( - cr, uid, sepa_export.payment_order_ids[0].company_id.id, + cr, uid, + gen_args['sepa_export'].payment_order_ids[0].company_id.id, context=context) - initiating_party_issuer = \ - sepa_export.payment_order_ids[0].company_id.initiating_party_issuer + initiating_party_issuer = gen_args['sepa_export'].\ + payment_order_ids[0].company_id.initiating_party_issuer if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') @@ -306,7 +352,8 @@ class banking_export_pain(orm.AbstractModel): if not line.struct_communication_type: raise orm.except_orm( _('Error:'), - _("Missing 'Structured Communication Type' on payment line with your reference '%s'.") + _("Missing 'Structured Communication Type' on payment " + "line with reference '%s'.") % (line.name)) remittance_info_unstructured_2_100 = etree.SubElement( remittance_info_2_91, 'Strd') diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index 31c709fb5..2c238cc6a 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -31,7 +31,8 @@ class res_company(orm.Model): _columns = { 'initiating_party_issuer': fields.char( 'Initiating Party Issuer', size=35, - help="This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP."), + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by OpenERP."), } def _get_initiating_party_identifier( diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot new file mode 100644 index 000000000..d4a7dbac5 --- /dev/null +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -0,0 +1,146 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2013-12-23 21:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "" + diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po new file mode 100644 index 000000000..22a9c9232 --- /dev/null +++ b/account_banking_pain_base/i18n/fr.po @@ -0,0 +1,146 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:27+0000\n" +"PO-Revision-Date: 2013-12-23 21:27+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma XML officiel. Le fichier XML généré et le message d'erreur complet ont été écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être une idée sur la cause du problème : %s" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Priorité" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Ligne de paiement" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Mode de paiement" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." +msgstr "Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés par OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "Le 'Type de communication structuré' n'est pas renseigné sur la ligne de paiement ayant la référence '%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Impossible de calculer le '%s' de la ligne de paiement ayant la référence '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Impossible de calculer le '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "Le type du champ '%s' est %s. Il devrait être de type string ou unicode." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Erreur :" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Cet IBAN n'est pas valide : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Erreur dans le type de champ :" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Type de communication structurée" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "Si actif, OpenERP convertira chaque caractère accentué en son équivalent non accentué, de telle façon que seuls des caractères ASCII soient utilisés dans le fichier PAIN généré." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Élevé" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Convertir en ASCII" + diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py index 11d597e4d..0dffbcf42 100644 --- a/account_banking_pain_base/payment_line.py +++ b/account_banking_pain_base/payment_line.py @@ -34,11 +34,14 @@ class payment_line(orm.Model): ('NORM', 'Normal'), ('HIGH', 'High'), ], 'Priority', - help="This field will be used as the 'Instruction Priority' in the generated PAIN files."), + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file."), # Update size from 64 to 140, because PAIN allows 140 caracters 'communication': fields.char( 'Communication', size=140, required=True, - help="Used as the message between ordering customer and current company. Depicts 'What do you want to say to the recipient about this order ?'"), + help="Used as the message between ordering customer and current " + "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'), } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml index ea0005faf..40087836c 100644 --- a/account_banking_pain_base/payment_line_view.xml +++ b/account_banking_pain_base/payment_line_view.xml @@ -14,11 +14,12 @@ + + - @@ -29,11 +30,12 @@ + + - diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py index 7113ccc78..540d01b67 100644 --- a/account_banking_pain_base/payment_mode.py +++ b/account_banking_pain_base/payment_mode.py @@ -29,7 +29,9 @@ class payment_mode(orm.Model): _columns = { 'convert_to_ascii': fields.boolean( 'Convert to ASCII', - help="If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file."), + help="If active, OpenERP will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file."), } _defaults = { From ecc13f8dd1353f2afe127b018baf3011314069aa Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 24 Dec 2013 15:30:37 +0100 Subject: [PATCH 09/79] Update module description. --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 5d461865e..9803980d5 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -43,7 +43,7 @@ This module contains fields and functions that are used by the module for SEPA C This module is part of the banking addons: https://launchpad.net/banking-addons -This module was developped during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France). +This module was started during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France). ''', 'active': False, 'installable': True, From 177d7d827c8af55572c3b52d3d72a14c667dfe0b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 4 Jan 2014 14:14:54 +0100 Subject: [PATCH 10/79] Put the field communication2 back in the view of payment lines. Rename a badly named variable (thanks to Stefan Rijnhart for spotting this) --- account_banking_pain_base/banking_export_pain.py | 4 ++-- account_banking_pain_base/payment_line_view.xml | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 30a1d5474..1db13aa83 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -355,10 +355,10 @@ class banking_export_pain(orm.AbstractModel): _("Missing 'Structured Communication Type' on payment " "line with reference '%s'.") % (line.name)) - remittance_info_unstructured_2_100 = etree.SubElement( + remittance_info_structured_2_100 = etree.SubElement( remittance_info_2_91, 'Strd') creditor_ref_information_2_120 = etree.SubElement( - remittance_info_unstructured_2_100, 'CdtrRefInf') + remittance_info_structured_2_100, 'CdtrRefInf') if gen_args.get('pain_flavor') == 'pain.001.001.02': creditor_ref_info_type_2_121 = etree.SubElement( creditor_ref_information_2_120, 'CdtrRefTp') diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml index 40087836c..f92b1bbf5 100644 --- a/account_banking_pain_base/payment_line_view.xml +++ b/account_banking_pain_base/payment_line_view.xml @@ -16,7 +16,6 @@ - @@ -32,7 +31,6 @@ - From 2ae37c902ebdbcc111fd5db6903c99ba15835160 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 5 Jan 2014 00:24:47 +0100 Subject: [PATCH 11/79] If it's a national payment, we now support "BIC not provided". --- .../banking_export_pain.py | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 1db13aa83..64cd3ed6e 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -280,19 +280,36 @@ class banking_export_pain(orm.AbstractModel): iniparty_org_other_issuer.text = initiating_party_issuer return True - def generate_party_bic( - self, cr, uid, parent_node, party_type, party_type_label, bic, - eval_ctx, gen_args, context=None): + def generate_party_agent( + self, cr, uid, parent_node, party_type, party_type_label, + order, party_name, iban, bic, eval_ctx, gen_args, context=None): '''Generate the piece of the XML file corresponding to BIC This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) party_agent_institution = etree.SubElement( party_agent, 'FinInstnId') - party_agent_bic = etree.SubElement( - party_agent_institution, gen_args.get('bic_xml_tag')) - party_agent_bic.text = self._prepare_field( - cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, - gen_args=gen_args, context=context) + try: + bic = self._prepare_field( + cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, + gen_args=gen_args, context=context) + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = bic + except: + if order == 'C': + if iban[0:2] != gen_args['initiating_party_country_code']: + raise orm.except_orm( + _('Error:'), + _("The bank account with IBAN '%s' of partner '%s' " + "must have an associated BIC because it is a " + "cross-border SEPA operation.") + % (iban, party_name)) + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' return True def generate_party_block( @@ -305,32 +322,37 @@ class banking_export_pain(orm.AbstractModel): party_type_label = 'Creditor' elif party_type == 'Dbtr': party_type_label = 'Debtor' - # At C level, the order is : BIC, Name, IBAN - # At B level, the order is : Name, IBAN, BIC - if order == 'C': - self.generate_party_bic( - cr, uid, parent_node, party_type, party_type_label, bic, - eval_ctx, gen_args, context=context) - party = etree.SubElement(parent_node, party_type) - party_name = etree.SubElement(party, 'Nm') - party_name.text = self._prepare_field( + party_name = self._prepare_field( cr, uid, '%s Name' % party_type_label, name, eval_ctx, gen_args.get('name_maxsize'), gen_args=gen_args, context=context) - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') piban = self._prepare_field( cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args, context=context) viban = self._validate_iban(cr, uid, piban, context=context) + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'B': + gen_args['initiating_party_country_code'] = viban[0:2] + elif order == 'C': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + party = etree.SubElement(parent_node, party_type) + party_nm = etree.SubElement(party, 'Nm') + party_nm.text = party_name + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') party_account_iban.text = viban if order == 'B': - self.generate_party_bic( - cr, uid, parent_node, party_type, party_type_label, bic, + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, eval_ctx, gen_args, context=context) return True From eb7be676438d9dcddbd457e46c7f3c6e8ef315b9 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 6 Jan 2014 00:51:22 +0100 Subject: [PATCH 12/79] For SCT, if BIC is not provided, we should not put the 'Creditor Agent' block at all, according to EPC guidelines (on this point, it is different from the Direct Debit !) --- .../banking_export_pain.py | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 64cd3ed6e..8e2ac7d8f 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -209,12 +209,7 @@ class banking_export_pain(orm.AbstractModel): payment_info_ident, eval_ctx, 35, gen_args=gen_args, context=context) payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') - if gen_args.get('pain_flavor').startswith('pain.008.'): - payment_method_2_2.text = 'DD' - request_date_tag = 'ReqdColltnDt' - else: - payment_method_2_2.text = 'TRF' - request_date_tag = 'ReqdExctnDt' + payment_method_2_2.text = gen_args['payment_method'] if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') batch_booking_2_3.text = \ @@ -247,6 +242,10 @@ class banking_export_pain(orm.AbstractModel): payment_type_info_2_6, 'SeqTp') sequence_type_2_14.text = sequence_type + if gen_args['payment_method'] == 'DD': + request_date_tag = 'ReqdColltnDt' + else: + request_date_tag = 'ReqdExctnDt' requested_date_2_17 = etree.SubElement( payment_info_2_0, request_date_tag) requested_date_2_17.text = requested_date @@ -286,13 +285,13 @@ class banking_export_pain(orm.AbstractModel): '''Generate the piece of the XML file corresponding to BIC This code is mutualized between TRF and DD''' assert order in ('B', 'C'), "Order can be 'B' or 'C'" - party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') try: bic = self._prepare_field( cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, gen_args=gen_args, context=context) + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = bic @@ -305,11 +304,20 @@ class banking_export_pain(orm.AbstractModel): "must have an associated BIC because it is a " "cross-border SEPA operation.") % (iban, party_name)) - party_agent_other = etree.SubElement( - party_agent_institution, 'Othr') - party_agent_other_identification = etree.SubElement( - party_agent_other, 'Id') - party_agent_other_identification.text = 'NOTPROVIDED' + if order == 'B' or ( + order == 'C' and gen_args['payment_method'] == 'DD'): + party_agent = etree.SubElement( + parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' + # for Credit Transfers, in the 'C' block, if BIC is not provided, + # we should not put the 'Creditor Agent' block at all, + # as per the guidelines of the EPC return True def generate_party_block( From c014436e5e1aca4c360a320ee6ffe2b91eb044aa Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Jan 2014 13:41:25 +0100 Subject: [PATCH 13/79] Only catch the openerp exception in generate_party_agent(), as suggested by Stefan on the MP. --- account_banking_pain_base/banking_export_pain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 8e2ac7d8f..5a063c5ee 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -295,7 +295,7 @@ class banking_export_pain(orm.AbstractModel): party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = bic - except: + except except_orm: if order == 'C': if iban[0:2] != gen_args['initiating_party_country_code']: raise orm.except_orm( From 6a38c5c816b1991206e11d360fee4d3805b5f65a Mon Sep 17 00:00:00 2001 From: "Ignacio Ibeas - Acysos S.L" Date: Thu, 13 Feb 2014 17:21:09 +0100 Subject: [PATCH 14/79] [FIX] account_banking_pain_base: support party identifier for Spain --- account_banking_pain_base/company.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index 2c238cc6a..cccafb7a8 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -47,6 +47,8 @@ class res_company(orm.Model): party_identifier = False if company_vat and company_vat[0:2].upper() in ['BE']: party_identifier = company_vat[2:].replace(' ', '') + if company_vat and company_vat[0:2].upper() in ['ES']: + party_identifier = company.sepa_creditor_identifier return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): From 6855968fe60b9dccf4eeaacf353a8c84fc118df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 16 Feb 2014 14:55:30 +0100 Subject: [PATCH 15/79] [FIX] trivial bug fix --- account_banking_pain_base/banking_export_pain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py index 5a063c5ee..279dc5f5a 100644 --- a/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/banking_export_pain.py @@ -295,7 +295,7 @@ class banking_export_pain(orm.AbstractModel): party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = bic - except except_orm: + except orm.except_orm: if order == 'C': if iban[0:2] != gen_args['initiating_party_country_code']: raise orm.except_orm( From 7516f43ef3004cac866e2115c27bde1da2ee13a5 Mon Sep 17 00:00:00 2001 From: "Ignacio Ibeas - Acysos S.L" Date: Mon, 24 Feb 2014 18:57:05 +0100 Subject: [PATCH 16/79] [FIX] account_banling_pain_base: refactored --- account_banking_pain_base/company.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index cccafb7a8..94864d548 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -45,10 +45,12 @@ class res_company(orm.Model): company = self.browse(cr, uid, company_id, context=context) company_vat = company.vat party_identifier = False - if company_vat and company_vat[0:2].upper() in ['BE']: - party_identifier = company_vat[2:].replace(' ', '') - if company_vat and company_vat[0:2].upper() in ['ES']: - party_identifier = company.sepa_creditor_identifier + if company_vat: + country_code = company_vat[0:2].upper() + if country_code == 'BE': + party_identifier = company_vat[2:].replace(' ', '') + elif country_code == 'ES': + party_identifier = company.sepa_creditor_identifier return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): From 726c762e8dff72379f5cd62d015d468fc7287523 Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of banking-addons-team Date: Sat, 1 Feb 2014 06:56:49 +0000 Subject: [PATCH 17/79] Launchpad automatic translations update. --- account_banking_pain_base/i18n/fr.po | 60 +++++++--- account_banking_pain_base/i18n/nl.po | 172 +++++++++++++++++++++++++++ 2 files changed, 215 insertions(+), 17 deletions(-) create mode 100644 account_banking_pain_base/i18n/nl.po diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index 22a9c9232..f1be6ac5d 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -6,14 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:27+0000\n" -"PO-Revision-Date: 2013-12-23 21:27+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-01 04:48+0000\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-03-08 06:59+0000\n" +"X-Generator: Launchpad (build 16948)\n" #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 @@ -23,8 +24,16 @@ msgstr "Initiating Party Issuer" #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/banking_export_pain.py:122 #, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" -msgstr "Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma XML officiel. Le fichier XML généré et le message d'erreur complet ont été écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être une idée sur la cause du problème : %s" +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma " +"XML officiel. Le fichier XML généré et le message d'erreur complet ont été " +"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " +"une idée sur la cause du problème : %s" #. module: account_banking_pain_base #: field:payment.line,priority:0 @@ -43,14 +52,21 @@ msgstr "Mode de paiement" #. module: account_banking_pain_base #: help:res.company,initiating_party_issuer:0 -msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." -msgstr "Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés par OpenERP." +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés " +"par OpenERP." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/banking_export_pain.py:351 #, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "Le 'Type de communication structuré' n'est pas renseigné sur la ligne de paiement ayant la référence '%s'." +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Le 'Type de communication structuré' n'est pas renseigné sur la ligne de " +"paiement ayant la référence '%s'." #. module: account_banking_pain_base #: selection:payment.line,priority:0 @@ -61,7 +77,9 @@ msgstr "Normal" #: code:addons/account_banking_pain_base/banking_export_pain.py:70 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "Impossible de calculer le '%s' de la ligne de paiement ayant la référence '%s'." +msgstr "" +"Impossible de calculer le '%s' de la ligne de paiement ayant la référence " +"'%s'." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/banking_export_pain.py:77 @@ -73,7 +91,8 @@ msgstr "Impossible de calculer le '%s'." #: code:addons/account_banking_pain_base/banking_export_pain.py:81 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "Le type du champ '%s' est %s. Il devrait être de type string ou unicode." +msgstr "" +"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/banking_export_pain.py:47 @@ -121,12 +140,20 @@ msgstr "banking.export.pain" #. module: account_banking_pain_base #: help:payment.mode,convert_to_ascii:0 -msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." -msgstr "Si actif, OpenERP convertira chaque caractère accentué en son équivalent non accentué, de telle façon que seuls des caractères ASCII soient utilisés dans le fichier PAIN généré." +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Si actif, OpenERP convertira chaque caractère accentué en son équivalent non " +"accentué, de telle façon que seuls des caractères ASCII soient utilisés dans " +"le fichier PAIN généré." #. module: account_banking_pain_base #: help:payment.line,priority:0 -msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." #. module: account_banking_pain_base @@ -143,4 +170,3 @@ msgstr "Élevé" #: field:payment.mode,convert_to_ascii:0 msgid "Convert to ASCII" msgstr "Convertir en ASCII" - diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po new file mode 100644 index 000000000..565dff9e6 --- /dev/null +++ b/account_banking_pain_base/i18n/nl.po @@ -0,0 +1,172 @@ +# Dutch translation for banking-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the banking-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: banking-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-11 08:32+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-03-08 06:59+0000\n" +"X-Generator: Launchpad (build 16948)\n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema " +"definities. Het gegenereerde XML bestand en de volledige fout zijn " +"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee " +"kunt geven over de oorzaak van het probleem: %s\"" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Prioriteit" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Betaalregel" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Betaalwijze" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Dit wordt gebruikt als de 'Initiating Party Issuer' in de PAIN bestanden " +"gegenereerd door OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Ontbrekende 'Structured Communication Type' op betaalregel met referentie " +"'%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normaal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Kan de '%s' niet berekenen." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Fout:" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Deze IBAN is niet geldig : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Veld type fout:" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Structured Communication Type" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Indien aangevinkt, zal OpenERP elk geaccentueerde karakter omzetten in een " +"overeenkomstige ongeaccentueerde karakter, zodat alleen ASCII karakters " +"worden gebruikt in het gegenereerde PAIN bestand." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" +"Dit veld wordt gebruikt als de 'Instruction Priority' in het gegenereerde " +"PAIN bestand." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Hoog" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Converteer naar ASCII" From b89c82a6c3e6a79314e53b02c4a979c3f184fcf3 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 12 Mar 2014 23:18:33 +0100 Subject: [PATCH 18/79] Add missing utf-8 header Update state field on SEPA file objects and display it in tree+form views. Migrate form views to version 7.0 and simplify them. --- account_banking_pain_base/__openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 9803980d5..71c52d5d0 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -1,3 +1,4 @@ +# -*- encoding: utf-8 -*- ############################################################################## # # PAIN base module for OpenERP From 105951bfc17686c36f324d05db8aafc52417b469 Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of banking-addons-team Date: Fri, 21 Mar 2014 06:57:59 +0000 Subject: [PATCH 19/79] Launchpad automatic translations update. --- account_banking_pain_base/i18n/fr.po | 4 ++-- account_banking_pain_base/i18n/nl.po | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index f1be6ac5d..e58b8ece0 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-08 06:59+0000\n" -"X-Generator: Launchpad (build 16948)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po index 565dff9e6..721d24f68 100644 --- a/account_banking_pain_base/i18n/nl.po +++ b/account_banking_pain_base/i18n/nl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-08 06:59+0000\n" -"X-Generator: Launchpad (build 16948)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 From 295316d73f0558899f7190f9acd6b01e9b316b73 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Thu, 21 Aug 2014 13:03:35 -0400 Subject: [PATCH 20/79] PEP8 on account_banking_pain_base --- account_banking_pain_base/__openerp__.py | 11 ++++++++--- account_banking_pain_base/company.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 71c52d5d0..f2a6ad0d0 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -40,11 +40,16 @@ Base module for PAIN file generation ==================================== -This module contains fields and functions that are used by the module for SEPA Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit (account_banking_sepa_direct_debit). This module doesn't provide any functionnality by itself. +This module contains fields and functions that are used by the module for SEPA +Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit +(account_banking_sepa_direct_debit). This module doesn't provide any +functionnality by itself. -This module is part of the banking addons: https://launchpad.net/banking-addons +This module is part of the banking addons: + https://www.github.com/OCA/banking-addons -This module was started during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France). +This module was started during the Akretion-Noviat code sprint of +November 21st 2013 in Epiais les Louvres (France). ''', 'active': False, 'installable': True, diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py index 94864d548..222786c27 100644 --- a/account_banking_pain_base/company.py +++ b/account_banking_pain_base/company.py @@ -50,7 +50,7 @@ class res_company(orm.Model): if country_code == 'BE': party_identifier = company_vat[2:].replace(' ', '') elif country_code == 'ES': - party_identifier = company.sepa_creditor_identifier + party_identifier = company.sepa_creditor_identifier return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): From 97d3a49defa057c9c6aeaf850a3776055c6e8645 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 10 Sep 2014 12:19:20 +0200 Subject: [PATCH 21/79] Initial adjustments for 8.0 repository --- account_banking_pain_base/__init__.py | 26 -- account_banking_pain_base/__openerp__.py | 56 --- .../banking_export_pain.py | 439 ------------------ account_banking_pain_base/company.py | 82 ---- account_banking_pain_base/company_view.xml | 24 - .../i18n/account_banking_pain_base.pot | 146 ------ account_banking_pain_base/i18n/fr.po | 172 ------- account_banking_pain_base/i18n/nl.po | 172 ------- account_banking_pain_base/payment_line.py | 52 --- .../payment_line_view.xml | 41 -- account_banking_pain_base/payment_mode.py | 39 -- .../payment_mode_view.xml | 22 - 12 files changed, 1271 deletions(-) delete mode 100644 account_banking_pain_base/__init__.py delete mode 100644 account_banking_pain_base/__openerp__.py delete mode 100644 account_banking_pain_base/banking_export_pain.py delete mode 100644 account_banking_pain_base/company.py delete mode 100644 account_banking_pain_base/company_view.xml delete mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot delete mode 100644 account_banking_pain_base/i18n/fr.po delete mode 100644 account_banking_pain_base/i18n/nl.po delete mode 100644 account_banking_pain_base/payment_line.py delete mode 100644 account_banking_pain_base/payment_line_view.xml delete mode 100644 account_banking_pain_base/payment_mode.py delete mode 100644 account_banking_pain_base/payment_mode_view.xml diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py deleted file mode 100644 index 6662843e6..000000000 --- a/account_banking_pain_base/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . import payment_line -from . import payment_mode -from . import company -from . import banking_export_pain diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py deleted file mode 100644 index f2a6ad0d0..000000000 --- a/account_banking_pain_base/__openerp__.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## -{ - 'name': 'Account Banking PAIN Base Module', - 'summary': 'Base module for PAIN file generation', - 'version': '0.1', - 'license': 'AGPL-3', - 'author': 'Akretion, Noviat', - 'website': 'http://openerp-community-association.org/', - 'category': 'Hidden', - 'depends': ['account_banking_payment_export'], - 'external_dependencies': { - 'python': ['unidecode', 'lxml'], - }, - 'data': [ - 'payment_line_view.xml', - 'payment_mode_view.xml', - 'company_view.xml', - ], - 'description': ''' -Base module for PAIN file generation -==================================== - -This module contains fields and functions that are used by the module for SEPA -Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit -(account_banking_sepa_direct_debit). This module doesn't provide any -functionnality by itself. - -This module is part of the banking addons: - https://www.github.com/OCA/banking-addons - -This module was started during the Akretion-Noviat code sprint of -November 21st 2013 in Epiais les Louvres (France). - ''', - 'active': False, - 'installable': True, -} diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py deleted file mode 100644 index 279dc5f5a..000000000 --- a/account_banking_pain_base/banking_export_pain.py +++ /dev/null @@ -1,439 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm -from openerp.tools.translate import _ -from openerp.tools.safe_eval import safe_eval -from datetime import datetime -from unidecode import unidecode -from lxml import etree -from openerp import tools -import logging -import base64 - -logger = logging.getLogger(__name__) - - -class banking_export_pain(orm.AbstractModel): - _name = 'banking.export.pain' - - def _validate_iban(self, cr, uid, iban, context=None): - '''if IBAN is valid, returns IBAN - if IBAN is NOT valid, raises an error message''' - partner_bank_obj = self.pool.get('res.partner.bank') - if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): - return iban.replace(' ', '') - else: - raise orm.except_orm( - _('Error:'), _("This IBAN is not valid : %s") % iban) - - def _prepare_field( - self, cr, uid, field_name, field_value, eval_ctx, max_size=0, - gen_args=None, context=None): - '''This function is designed to be inherited !''' - if gen_args is None: - gen_args = {} - assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' - try: - value = safe_eval(field_value, eval_ctx) - # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters - # But we are dealing with banks... - # and many banks don't want non-ASCCI characters ! - # cf section 1.4 "Character set" of the SEPA Credit Transfer - # Scheme Customer-to-bank guidelines - if gen_args.get('convert_to_ascii'): - value = unidecode(value) - unallowed_ascii_chars = [ - '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', - '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] - for unallowed_ascii_char in unallowed_ascii_chars: - value = value.replace(unallowed_ascii_char, '-') - except: - line = eval_ctx.get('line') - if line: - raise orm.except_orm( - _('Error:'), - _("Cannot compute the '%s' of the Payment Line with " - "reference '%s'.") - % (field_name, line.name)) - else: - raise orm.except_orm( - _('Error:'), - _("Cannot compute the '%s'.") % field_name) - if not isinstance(value, (str, unicode)): - raise orm.except_orm( - _('Field type error:'), - _("The type of the field '%s' is %s. It should be a string " - "or unicode.") - % (field_name, type(value))) - if not value: - raise orm.except_orm( - _('Error:'), - _("The '%s' is empty or 0. It should have a non-null value.") - % field_name) - if max_size and len(value) > max_size: - value = value[0:max_size] - return value - - def _prepare_export_sepa( - self, cr, uid, total_amount, transactions_count, xml_string, - gen_args, context=None): - return { - 'batch_booking': gen_args['sepa_export'].batch_booking, - 'charge_bearer': gen_args['sepa_export'].charge_bearer, - 'total_amount': total_amount, - 'nb_transactions': transactions_count, - 'file': base64.encodestring(xml_string), - 'payment_order_ids': [( - 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] - )], - } - - def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): - xsd_etree_obj = etree.parse( - tools.file_open(gen_args['pain_xsd_file'])) - official_pain_schema = etree.XMLSchema(xsd_etree_obj) - - try: - root_to_validate = etree.fromstring(xml_string) - official_pain_schema.assertValid(root_to_validate) - except Exception, e: - logger.warning( - "The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) - logger.warning(e) - raise orm.except_orm( - _('Error:'), - _("The generated XML file is not valid against the official " - "XML Schema Definition. The generated XML file and the " - "full error have been written in the server logs. Here " - "is the error, which may give you an idea on the cause " - "of the problem : %s") - % str(e)) - return True - - def finalize_sepa_file_creation( - self, cr, uid, ids, xml_root, total_amount, transactions_count, - gen_args, context=None): - xml_string = etree.tostring( - xml_root, pretty_print=True, encoding='UTF-8', - xml_declaration=True) - logger.debug( - "Generated SEPA XML file in format %s below" - % gen_args['pain_flavor']) - logger.debug(xml_string) - self._validate_xml(cr, uid, xml_string, gen_args, context=context) - - file_id = gen_args['file_obj'].create( - cr, uid, self._prepare_export_sepa( - cr, uid, total_amount, transactions_count, - xml_string, gen_args, context=context), - context=context) - - self.write( - cr, uid, ids, { - 'file_id': file_id, - 'state': 'finish', - }, context=context) - - action = { - 'name': 'SEPA File', - 'type': 'ir.actions.act_window', - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': self._name, - 'res_id': ids[0], - 'target': 'new', - } - return action - - def generate_group_header_block( - self, cr, uid, parent_node, gen_args, context=None): - group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') - message_identification_1_1 = etree.SubElement( - group_header_1_0, 'MsgId') - message_identification_1_1.text = self._prepare_field( - cr, uid, 'Message Identification', - 'sepa_export.payment_order_ids[0].reference', - {'sepa_export': gen_args['sepa_export']}, 35, - gen_args=gen_args, context=context) - creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') - creation_date_time_1_2.text = datetime.strftime( - datetime.today(), '%Y-%m-%dT%H:%M:%S') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - # batch_booking is in "Group header" with pain.001.001.02 - # and in "Payment info" in pain.001.001.03/04 - batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') - batch_booking.text = \ - str(gen_args['sepa_export'].batch_booking).lower() - nb_of_transactions_1_6 = etree.SubElement( - group_header_1_0, 'NbOfTxs') - control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') - # Grpg removed in pain.001.001.03 - if gen_args.get('pain_flavor') == 'pain.001.001.02': - grouping = etree.SubElement(group_header_1_0, 'Grpg') - grouping.text = 'GRPD' - self.generate_initiating_party_block( - cr, uid, group_header_1_0, gen_args, - context=context) - return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 - - def generate_start_payment_info_block( - self, cr, uid, parent_node, payment_info_ident, - priority, local_instrument, sequence_type, requested_date, - eval_ctx, gen_args, context=None): - payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') - payment_info_identification_2_1 = etree.SubElement( - payment_info_2_0, 'PmtInfId') - payment_info_identification_2_1.text = self._prepare_field( - cr, uid, 'Payment Information Identification', - payment_info_ident, eval_ctx, 35, - gen_args=gen_args, context=context) - payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') - payment_method_2_2.text = gen_args['payment_method'] - if gen_args.get('pain_flavor') != 'pain.001.001.02': - batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = \ - str(gen_args['sepa_export'].batch_booking).lower() - # The "SEPA Customer-to-bank - # Implementation guidelines" for SCT and SDD says that control sum - # and nb_of_transactions should be present - # at both "group header" level and "payment info" level - nb_of_transactions_2_4 = etree.SubElement( - payment_info_2_0, 'NbOfTxs') - 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: - instruction_priority_2_7 = etree.SubElement( - payment_type_info_2_6, 'InstrPrty') - instruction_priority_2_7.text = priority - service_level_2_8 = etree.SubElement( - payment_type_info_2_6, 'SvcLvl') - service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') - service_level_code_2_9.text = 'SEPA' - if local_instrument: - local_instrument_2_11 = etree.SubElement( - payment_type_info_2_6, 'LclInstrm') - local_instr_code_2_12 = etree.SubElement( - local_instrument_2_11, 'Cd') - local_instr_code_2_12.text = local_instrument - if sequence_type: - sequence_type_2_14 = etree.SubElement( - payment_type_info_2_6, 'SeqTp') - sequence_type_2_14.text = sequence_type - - if gen_args['payment_method'] == 'DD': - request_date_tag = 'ReqdColltnDt' - else: - request_date_tag = 'ReqdExctnDt' - requested_date_2_17 = etree.SubElement( - payment_info_2_0, request_date_tag) - requested_date_2_17.text = requested_date - return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 - - def generate_initiating_party_block( - self, cr, uid, parent_node, gen_args, context=None): - my_company_name = self._prepare_field( - cr, uid, 'Company Name', - 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', - {'sepa_export': gen_args['sepa_export']}, - gen_args.get('name_maxsize'), gen_args=gen_args, context=context) - initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') - initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') - initiating_party_name.text = my_company_name - initiating_party_identifier = self.pool['res.company'].\ - _get_initiating_party_identifier( - cr, uid, - gen_args['sepa_export'].payment_order_ids[0].company_id.id, - context=context) - initiating_party_issuer = gen_args['sepa_export'].\ - payment_order_ids[0].company_id.initiating_party_issuer - if initiating_party_identifier and initiating_party_issuer: - iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') - iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') - iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') - iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') - iniparty_org_other_id.text = initiating_party_identifier - iniparty_org_other_issuer = etree.SubElement( - iniparty_org_other, 'Issr') - iniparty_org_other_issuer.text = initiating_party_issuer - return True - - def generate_party_agent( - self, cr, uid, parent_node, party_type, party_type_label, - order, party_name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD''' - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - try: - bic = self._prepare_field( - cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, - gen_args=gen_args, context=context) - party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_bic = etree.SubElement( - party_agent_institution, gen_args.get('bic_xml_tag')) - party_agent_bic.text = bic - except orm.except_orm: - if order == 'C': - if iban[0:2] != gen_args['initiating_party_country_code']: - raise orm.except_orm( - _('Error:'), - _("The bank account with IBAN '%s' of partner '%s' " - "must have an associated BIC because it is a " - "cross-border SEPA operation.") - % (iban, party_name)) - if order == 'B' or ( - order == 'C' and gen_args['payment_method'] == 'DD'): - party_agent = etree.SubElement( - parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_other = etree.SubElement( - party_agent_institution, 'Othr') - party_agent_other_identification = etree.SubElement( - party_agent_other, 'Id') - party_agent_other_identification.text = 'NOTPROVIDED' - # for Credit Transfers, in the 'C' block, if BIC is not provided, - # we should not put the 'Creditor Agent' block at all, - # as per the guidelines of the EPC - return True - - def generate_party_block( - self, cr, uid, parent_node, party_type, order, name, iban, bic, - eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD''' - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - if party_type == 'Cdtr': - party_type_label = 'Creditor' - elif party_type == 'Dbtr': - party_type_label = 'Debtor' - party_name = self._prepare_field( - cr, uid, '%s Name' % party_type_label, name, eval_ctx, - gen_args.get('name_maxsize'), - gen_args=gen_args, context=context) - piban = self._prepare_field( - cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, - gen_args=gen_args, - context=context) - viban = self._validate_iban(cr, uid, piban, context=context) - # At C level, the order is : BIC, Name, IBAN - # At B level, the order is : Name, IBAN, BIC - if order == 'B': - gen_args['initiating_party_country_code'] = viban[0:2] - elif order == 'C': - self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) - party = etree.SubElement(parent_node, party_type) - party_nm = etree.SubElement(party, 'Nm') - party_nm.text = party_name - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') - party_account_iban.text = viban - if order == 'B': - self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) - return True - - def generate_remittance_info_block( - self, cr, uid, parent_node, line, gen_args, context=None): - - remittance_info_2_91 = etree.SubElement( - parent_node, 'RmtInf') - if line.state == 'normal': - remittance_info_unstructured_2_99 = etree.SubElement( - remittance_info_2_91, 'Ustrd') - remittance_info_unstructured_2_99.text = \ - self._prepare_field( - cr, uid, 'Remittance Unstructured Information', - 'line.communication', {'line': line}, 140, - gen_args=gen_args, - context=context) - else: - if not line.struct_communication_type: - raise orm.except_orm( - _('Error:'), - _("Missing 'Structured Communication Type' on payment " - "line with reference '%s'.") - % (line.name)) - remittance_info_structured_2_100 = etree.SubElement( - remittance_info_2_91, 'Strd') - creditor_ref_information_2_120 = etree.SubElement( - remittance_info_structured_2_100, 'CdtrRefInf') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRefTp') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_2_121, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRef') - else: - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'Tp') - creditor_ref_info_type_or_2_122 = etree.SubElement( - creditor_ref_info_type_2_121, 'CdOrPrtry') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_or_2_122, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'Ref') - - creditor_ref_info_type_code_2_123.text = 'SCOR' - creditor_ref_info_type_issuer_2_125.text = \ - line.struct_communication_type - creditor_reference_2_126.text = \ - self._prepare_field( - cr, uid, 'Creditor Structured Reference', - 'line.communication', {'line': line}, 35, - gen_args=gen_args, - context=context) - return True - - def generate_creditor_scheme_identification( - self, cr, uid, parent_node, identification, identification_label, - eval_ctx, scheme_name_proprietary, gen_args, context=None): - csi_id = etree.SubElement( - parent_node, 'Id') - csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') - csi_other = etree.SubElement(csi_privateid, 'Othr') - csi_other_id = etree.SubElement(csi_other, 'Id') - csi_other_id.text = self._prepare_field( - cr, uid, identification_label, identification, eval_ctx, - gen_args=gen_args, context=context) - csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') - csi_scheme_name_proprietary = etree.SubElement( - csi_scheme_name, 'Prtry') - csi_scheme_name_proprietary.text = scheme_name_proprietary - return True diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py deleted file mode 100644 index 222786c27..000000000 --- a/account_banking_pain_base/company.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# Copyright (C) 2013 Noviat (http://www.noviat.com) -# @author: Alexis de Lattre -# @author: Luc de Meyer (Noviat) -# -# 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.osv import orm, fields - - -class res_company(orm.Model): - _inherit = 'res.company' - - _columns = { - 'initiating_party_issuer': fields.char( - 'Initiating Party Issuer', size=35, - help="This will be used as the 'Initiating Party Issuer' in the " - "PAIN files generated by OpenERP."), - } - - def _get_initiating_party_identifier( - self, cr, uid, company_id, context=None): - '''The code here may be different from one country to another. - If you need to add support for an additionnal country, you can - contribute your code here or inherit this function in the - localization modules for your country''' - assert isinstance(company_id, int), 'Only one company ID' - company = self.browse(cr, uid, company_id, context=context) - company_vat = company.vat - party_identifier = False - if company_vat: - country_code = company_vat[0:2].upper() - if country_code == 'BE': - party_identifier = company_vat[2:].replace(' ', '') - elif country_code == 'ES': - party_identifier = company.sepa_creditor_identifier - return party_identifier - - def _initiating_party_issuer_default(self, cr, uid, context=None): - '''If you need to add support for an additionnal country, you can - add an entry in the dict "party_issuer_per_country" here - or inherit this function in the localization modules for - your country''' - initiating_party_issuer = '' - # If your country require the 'Initiating Party Issuer', you should - # contribute the entry for your country in the dict below - party_issuer_per_country = { - 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium - } - company_id = self._company_default_get( - cr, uid, 'res.company', context=context) - if company_id: - company = self.browse(cr, uid, company_id, context=context) - country_code = company.country_id.code - initiating_party_issuer = party_issuer_per_country.get( - country_code, '') - return initiating_party_issuer - - def _initiating_party_issuer_def(self, cr, uid, context=None): - return self._initiating_party_issuer_default( - cr, uid, context=context) - - _defaults = { - 'initiating_party_issuer': _initiating_party_issuer_def, - } diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml deleted file mode 100644 index a98d9b641..000000000 --- a/account_banking_pain_base/company_view.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - pain.group.on.res.company.form - res.company - - - - - - - - - - - - diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot deleted file mode 100644 index d4a7dbac5..000000000 --- a/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ /dev/null @@ -1,146 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2013-12-23 21:26+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "" - diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po deleted file mode 100644 index e58b8ece0..000000000 --- a/account_banking_pain_base/i18n/fr.po +++ /dev/null @@ -1,172 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2014-02-01 04:48+0000\n" -"Last-Translator: Alexis de Lattre \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" -"X-Generator: Launchpad (build 17031)\n" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "Initiating Party Issuer" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 -#, python-format -msgid "" -"The generated XML file is not valid against the official XML Schema " -"Definition. The generated XML file and the full error have been written in " -"the server logs. Here is the error, which may give you an idea on the cause " -"of the problem : %s" -msgstr "" -"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma " -"XML officiel. Le fichier XML généré et le message d'erreur complet ont été " -"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " -"une idée sur la cause du problème : %s" - -#. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "Priorité" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "Ligne de paiement" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "Mode de paiement" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by OpenERP." -msgstr "" -"Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés " -"par OpenERP." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "" -"Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" -"Le 'Type de communication structuré' n'est pas renseigné sur la ligne de " -"paiement ayant la référence '%s'." - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "Normal" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" -"Impossible de calculer le '%s' de la ligne de paiement ayant la référence " -"'%s'." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "Impossible de calculer le '%s'." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" -"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "Erreur :" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "Sociétés" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "Cet IBAN n'est pas valide : %s" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" -msgstr "Erreur dans le type de champ :" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "Type de communication structurée" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "banking.export.pain" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "" -"If active, OpenERP will convert each accented caracter to the corresponding " -"unaccented caracter, so that only ASCII caracters are used in the generated " -"PAIN file." -msgstr "" -"Si actif, OpenERP convertira chaque caractère accentué en son équivalent non " -"accentué, de telle façon que seuls des caractères ASCII soient utilisés dans " -"le fichier PAIN généré." - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "" -"This field will be used as the 'Instruction Priority' in the generated PAIN " -"file." -msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." - -#. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "Payment Initiation" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "Élevé" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "Convertir en ASCII" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po deleted file mode 100644 index 721d24f68..000000000 --- a/account_banking_pain_base/i18n/nl.po +++ /dev/null @@ -1,172 +0,0 @@ -# Dutch translation for banking-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the banking-addons package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: banking-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2014-02-11 08:32+0000\n" -"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" -"Language-Team: Dutch \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" -"X-Generator: Launchpad (build 17031)\n" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "Initiating Party Issuer" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 -#, python-format -msgid "" -"The generated XML file is not valid against the official XML Schema " -"Definition. The generated XML file and the full error have been written in " -"the server logs. Here is the error, which may give you an idea on the cause " -"of the problem : %s" -msgstr "" -"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema " -"definities. Het gegenereerde XML bestand en de volledige fout zijn " -"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee " -"kunt geven over de oorzaak van het probleem: %s\"" - -#. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "Prioriteit" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "Betaalregel" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "Betaalwijze" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by OpenERP." -msgstr "" -"Dit wordt gebruikt als de 'Initiating Party Issuer' in de PAIN bestanden " -"gegenereerd door OpenERP." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "" -"Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" -"Ontbrekende 'Structured Communication Type' op betaalregel met referentie " -"'%s'." - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "Normaal" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "Kan de '%s' niet berekenen." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "Fout:" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "Bedrijven" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "Deze IBAN is niet geldig : %s" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" -msgstr "Veld type fout:" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "Structured Communication Type" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "banking.export.pain" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "" -"If active, OpenERP will convert each accented caracter to the corresponding " -"unaccented caracter, so that only ASCII caracters are used in the generated " -"PAIN file." -msgstr "" -"Indien aangevinkt, zal OpenERP elk geaccentueerde karakter omzetten in een " -"overeenkomstige ongeaccentueerde karakter, zodat alleen ASCII karakters " -"worden gebruikt in het gegenereerde PAIN bestand." - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "" -"This field will be used as the 'Instruction Priority' in the generated PAIN " -"file." -msgstr "" -"Dit veld wordt gebruikt als de 'Instruction Priority' in het gegenereerde " -"PAIN bestand." - -#. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "Payment Initiation" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "Hoog" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "Converteer naar ASCII" diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py deleted file mode 100644 index 0dffbcf42..000000000 --- a/account_banking_pain_base/payment_line.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm, fields - - -class payment_line(orm.Model): - _inherit = 'payment.line' - - def _get_struct_communication_types(self, cr, uid, context=None): - return [('ISO', 'ISO')] - - _columns = { - 'priority': fields.selection([ - ('NORM', 'Normal'), - ('HIGH', 'High'), - ], 'Priority', - help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file."), - # Update size from 64 to 140, because PAIN allows 140 caracters - 'communication': fields.char( - 'Communication', size=140, required=True, - help="Used as the message between ordering customer and current " - "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'), - } - - _defaults = { - 'priority': 'NORM', - 'struct_communication_type': 'ISO', - } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml deleted file mode 100644 index f92b1bbf5..000000000 --- a/account_banking_pain_base/payment_line_view.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - pain.base.payment.line.form - payment.line - - - - - - - - - - - - - - pain.base.payment.line.inside.order.form - payment.order - - - - - - - - - - - - - - diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py deleted file mode 100644 index 540d01b67..000000000 --- a/account_banking_pain_base/payment_mode.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm, fields - - -class payment_mode(orm.Model): - _inherit = 'payment.mode' - - _columns = { - 'convert_to_ascii': fields.boolean( - 'Convert to ASCII', - help="If active, OpenERP will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file."), - } - - _defaults = { - 'convert_to_ascii': True, - } diff --git a/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/payment_mode_view.xml deleted file mode 100644 index 2deb24999..000000000 --- a/account_banking_pain_base/payment_mode_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - add.convert_to_ascii.in.payment.mode.form - payment.mode - - - - - - - - - - From 039ac02912a73ac1445d821cb170eb76dfdf7b66 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 10 Sep 2014 12:48:09 +0200 Subject: [PATCH 22/79] [MIG] Migration and enhancement of all modules involved in SEPA --- account_banking_pain_base/__init__.py | 23 + account_banking_pain_base/__openerp__.py | 53 +++ .../banking_export_pain.py | 439 +++++++++++++++++ account_banking_pain_base/company.py | 82 ++++ account_banking_pain_base/company_view.xml | 24 + .../i18n/account_banking_pain_base.pot | 146 ++++++ account_banking_pain_base/i18n/fr.po | 172 +++++++ account_banking_pain_base/i18n/nl.po | 172 +++++++ account_banking_pain_base/models/__init__.py | 26 ++ .../models/banking_export_pain.py | 440 ++++++++++++++++++ .../models/payment_line.py | 52 +++ .../models/payment_mode.py | 39 ++ .../models/res_company.py | 82 ++++ account_banking_pain_base/payment_line.py | 52 +++ .../payment_line_view.xml | 41 ++ account_banking_pain_base/payment_mode.py | 39 ++ .../payment_mode_view.xml | 22 + .../views/payment_line_view.xml | 41 ++ .../views/payment_mode_view.xml | 22 + .../views/res_company_view.xml | 24 + 20 files changed, 1991 insertions(+) create mode 100644 account_banking_pain_base/__init__.py create mode 100644 account_banking_pain_base/__openerp__.py create mode 100644 account_banking_pain_base/banking_export_pain.py create mode 100644 account_banking_pain_base/company.py create mode 100644 account_banking_pain_base/company_view.xml create mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot create mode 100644 account_banking_pain_base/i18n/fr.po create mode 100644 account_banking_pain_base/i18n/nl.po create mode 100644 account_banking_pain_base/models/__init__.py create mode 100644 account_banking_pain_base/models/banking_export_pain.py create mode 100644 account_banking_pain_base/models/payment_line.py create mode 100644 account_banking_pain_base/models/payment_mode.py create mode 100644 account_banking_pain_base/models/res_company.py create mode 100644 account_banking_pain_base/payment_line.py create mode 100644 account_banking_pain_base/payment_line_view.xml create mode 100644 account_banking_pain_base/payment_mode.py create mode 100644 account_banking_pain_base/payment_mode_view.xml create mode 100644 account_banking_pain_base/views/payment_line_view.xml create mode 100644 account_banking_pain_base/views/payment_mode_view.xml create mode 100644 account_banking_pain_base/views/res_company_view.xml diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py new file mode 100644 index 000000000..b69a01a1b --- /dev/null +++ b/account_banking_pain_base/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . import models diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py new file mode 100644 index 000000000..e7b199213 --- /dev/null +++ b/account_banking_pain_base/__openerp__.py @@ -0,0 +1,53 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## +{ + 'name': 'Account Banking PAIN Base Module', + 'summary': 'Base module for PAIN file generation', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Akretion, Noviat', + 'website': 'http://openerp-community-association.org/', + 'contributors': ['Pedro M. Baeza '], + 'category': 'Hidden', + 'depends': ['account_banking_payment_export'], + 'external_dependencies': { + 'python': ['unidecode', 'lxml'], + }, + 'data': [ + 'views/payment_line_view.xml', + 'views/payment_mode_view.xml', + 'views/res_company_view.xml', + ], + 'description': ''' +Base module for PAIN file generation +==================================== + +This module contains fields and functions that are used by the module for SEPA +Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit +(account_banking_sepa_direct_debit). This module doesn't provide any +functionality by itself. + +This module was started during the Akretion-Noviat code sprint of November +21st 2013 in Epiais les Louvres (France). + ''', + 'installable': True, +} diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py new file mode 100644 index 000000000..279dc5f5a --- /dev/null +++ b/account_banking_pain_base/banking_export_pain.py @@ -0,0 +1,439 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm +from openerp.tools.translate import _ +from openerp.tools.safe_eval import safe_eval +from datetime import datetime +from unidecode import unidecode +from lxml import etree +from openerp import tools +import logging +import base64 + +logger = logging.getLogger(__name__) + + +class banking_export_pain(orm.AbstractModel): + _name = 'banking.export.pain' + + def _validate_iban(self, cr, uid, iban, context=None): + '''if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message''' + partner_bank_obj = self.pool.get('res.partner.bank') + if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): + return iban.replace(' ', '') + else: + raise orm.except_orm( + _('Error:'), _("This IBAN is not valid : %s") % iban) + + def _prepare_field( + self, cr, uid, field_name, field_value, eval_ctx, max_size=0, + gen_args=None, context=None): + '''This function is designed to be inherited !''' + if gen_args is None: + gen_args = {} + assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' + try: + value = safe_eval(field_value, eval_ctx) + # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters + # But we are dealing with banks... + # and many banks don't want non-ASCCI characters ! + # cf section 1.4 "Character set" of the SEPA Credit Transfer + # Scheme Customer-to-bank guidelines + if gen_args.get('convert_to_ascii'): + value = unidecode(value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') + except: + line = eval_ctx.get('line') + if line: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s' of the Payment Line with " + "reference '%s'.") + % (field_name, line.name)) + else: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s'.") % field_name) + if not isinstance(value, (str, unicode)): + raise orm.except_orm( + _('Field type error:'), + _("The type of the field '%s' is %s. It should be a string " + "or unicode.") + % (field_name, type(value))) + if not value: + raise orm.except_orm( + _('Error:'), + _("The '%s' is empty or 0. It should have a non-null value.") + % field_name) + if max_size and len(value) > max_size: + value = value[0:max_size] + return value + + def _prepare_export_sepa( + self, cr, uid, total_amount, transactions_count, xml_string, + gen_args, context=None): + return { + 'batch_booking': gen_args['sepa_export'].batch_booking, + 'charge_bearer': gen_args['sepa_export'].charge_bearer, + 'total_amount': total_amount, + 'nb_transactions': transactions_count, + 'file': base64.encodestring(xml_string), + 'payment_order_ids': [( + 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] + )], + } + + def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): + xsd_etree_obj = etree.parse( + tools.file_open(gen_args['pain_xsd_file'])) + official_pain_schema = etree.XMLSchema(xsd_etree_obj) + + try: + root_to_validate = etree.fromstring(xml_string) + official_pain_schema.assertValid(root_to_validate) + except Exception, e: + logger.warning( + "The XML file is invalid against the XML Schema Definition") + logger.warning(xml_string) + logger.warning(e) + raise orm.except_orm( + _('Error:'), + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. Here " + "is the error, which may give you an idea on the cause " + "of the problem : %s") + % str(e)) + return True + + def finalize_sepa_file_creation( + self, cr, uid, ids, xml_root, total_amount, transactions_count, + gen_args, context=None): + xml_string = etree.tostring( + xml_root, pretty_print=True, encoding='UTF-8', + xml_declaration=True) + logger.debug( + "Generated SEPA XML file in format %s below" + % gen_args['pain_flavor']) + logger.debug(xml_string) + self._validate_xml(cr, uid, xml_string, gen_args, context=context) + + file_id = gen_args['file_obj'].create( + cr, uid, self._prepare_export_sepa( + cr, uid, total_amount, transactions_count, + xml_string, gen_args, context=context), + context=context) + + self.write( + cr, uid, ids, { + 'file_id': file_id, + 'state': 'finish', + }, context=context) + + action = { + 'name': 'SEPA File', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': self._name, + 'res_id': ids[0], + 'target': 'new', + } + return action + + def generate_group_header_block( + self, cr, uid, parent_node, gen_args, context=None): + group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') + message_identification_1_1 = etree.SubElement( + group_header_1_0, 'MsgId') + message_identification_1_1.text = self._prepare_field( + cr, uid, 'Message Identification', + 'sepa_export.payment_order_ids[0].reference', + {'sepa_export': gen_args['sepa_export']}, 35, + gen_args=gen_args, context=context) + creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') + creation_date_time_1_2.text = datetime.strftime( + datetime.today(), '%Y-%m-%dT%H:%M:%S') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + # batch_booking is in "Group header" with pain.001.001.02 + # and in "Payment info" in pain.001.001.03/04 + batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + nb_of_transactions_1_6 = etree.SubElement( + group_header_1_0, 'NbOfTxs') + control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + # Grpg removed in pain.001.001.03 + if gen_args.get('pain_flavor') == 'pain.001.001.02': + grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping.text = 'GRPD' + self.generate_initiating_party_block( + cr, uid, group_header_1_0, gen_args, + context=context) + return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + + def generate_start_payment_info_block( + self, cr, uid, parent_node, payment_info_ident, + priority, local_instrument, sequence_type, requested_date, + eval_ctx, gen_args, context=None): + payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification_2_1 = etree.SubElement( + payment_info_2_0, 'PmtInfId') + payment_info_identification_2_1.text = self._prepare_field( + cr, uid, 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, + gen_args=gen_args, context=context) + payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') + payment_method_2_2.text = gen_args['payment_method'] + if gen_args.get('pain_flavor') != 'pain.001.001.02': + batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') + batch_booking_2_3.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + # The "SEPA Customer-to-bank + # Implementation guidelines" for SCT and SDD says that control sum + # and nb_of_transactions should be present + # at both "group header" level and "payment info" level + nb_of_transactions_2_4 = etree.SubElement( + payment_info_2_0, 'NbOfTxs') + 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: + instruction_priority_2_7 = etree.SubElement( + payment_type_info_2_6, 'InstrPrty') + instruction_priority_2_7.text = priority + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' + if local_instrument: + local_instrument_2_11 = etree.SubElement( + payment_type_info_2_6, 'LclInstrm') + local_instr_code_2_12 = etree.SubElement( + local_instrument_2_11, 'Cd') + local_instr_code_2_12.text = local_instrument + if sequence_type: + sequence_type_2_14 = etree.SubElement( + payment_type_info_2_6, 'SeqTp') + sequence_type_2_14.text = sequence_type + + if gen_args['payment_method'] == 'DD': + request_date_tag = 'ReqdColltnDt' + else: + request_date_tag = 'ReqdExctnDt' + requested_date_2_17 = etree.SubElement( + payment_info_2_0, request_date_tag) + requested_date_2_17.text = requested_date + return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + + def generate_initiating_party_block( + self, cr, uid, parent_node, gen_args, context=None): + my_company_name = self._prepare_field( + cr, uid, 'Company Name', + 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', + {'sepa_export': gen_args['sepa_export']}, + gen_args.get('name_maxsize'), gen_args=gen_args, context=context) + initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party_name.text = my_company_name + initiating_party_identifier = self.pool['res.company'].\ + _get_initiating_party_identifier( + cr, uid, + gen_args['sepa_export'].payment_order_ids[0].company_id.id, + context=context) + initiating_party_issuer = gen_args['sepa_export'].\ + payment_order_ids[0].company_id.initiating_party_issuer + if initiating_party_identifier and initiating_party_issuer: + iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') + iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') + iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') + iniparty_org_other_id.text = initiating_party_identifier + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer + return True + + def generate_party_agent( + self, cr, uid, parent_node, party_type, party_type_label, + order, party_name, iban, bic, eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + try: + bic = self._prepare_field( + cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, + gen_args=gen_args, context=context) + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = bic + except orm.except_orm: + if order == 'C': + if iban[0:2] != gen_args['initiating_party_country_code']: + raise orm.except_orm( + _('Error:'), + _("The bank account with IBAN '%s' of partner '%s' " + "must have an associated BIC because it is a " + "cross-border SEPA operation.") + % (iban, party_name)) + if order == 'B' or ( + order == 'C' and gen_args['payment_method'] == 'DD'): + party_agent = etree.SubElement( + parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' + # for Credit Transfers, in the 'C' block, if BIC is not provided, + # we should not put the 'Creditor Agent' block at all, + # as per the guidelines of the EPC + return True + + def generate_party_block( + self, cr, uid, parent_node, party_type, order, name, iban, bic, + eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if party_type == 'Cdtr': + party_type_label = 'Creditor' + elif party_type == 'Dbtr': + party_type_label = 'Debtor' + party_name = self._prepare_field( + cr, uid, '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), + gen_args=gen_args, context=context) + piban = self._prepare_field( + cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, + gen_args=gen_args, + context=context) + viban = self._validate_iban(cr, uid, piban, context=context) + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'B': + gen_args['initiating_party_country_code'] = viban[0:2] + elif order == 'C': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + party = etree.SubElement(parent_node, party_type) + party_nm = etree.SubElement(party, 'Nm') + party_nm.text = party_name + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = viban + if order == 'B': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + return True + + def generate_remittance_info_block( + self, cr, uid, parent_node, line, gen_args, context=None): + + remittance_info_2_91 = etree.SubElement( + parent_node, 'RmtInf') + if line.state == 'normal': + remittance_info_unstructured_2_99 = etree.SubElement( + remittance_info_2_91, 'Ustrd') + remittance_info_unstructured_2_99.text = \ + self._prepare_field( + cr, uid, 'Remittance Unstructured Information', + 'line.communication', {'line': line}, 140, + gen_args=gen_args, + context=context) + else: + if not line.struct_communication_type: + raise orm.except_orm( + _('Error:'), + _("Missing 'Structured Communication Type' on payment " + "line with reference '%s'.") + % (line.name)) + remittance_info_structured_2_100 = etree.SubElement( + remittance_info_2_91, 'Strd') + creditor_ref_information_2_120 = etree.SubElement( + remittance_info_structured_2_100, 'CdtrRefInf') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRefTp') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_2_121, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRef') + else: + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'Tp') + creditor_ref_info_type_or_2_122 = etree.SubElement( + creditor_ref_info_type_2_121, 'CdOrPrtry') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_or_2_122, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'Ref') + + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125.text = \ + line.struct_communication_type + creditor_reference_2_126.text = \ + self._prepare_field( + cr, uid, 'Creditor Structured Reference', + 'line.communication', {'line': line}, 35, + gen_args=gen_args, + context=context) + return True + + def generate_creditor_scheme_identification( + self, cr, uid, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args, context=None): + csi_id = etree.SubElement( + parent_node, 'Id') + csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_other = etree.SubElement(csi_privateid, 'Othr') + csi_other_id = etree.SubElement(csi_other, 'Id') + csi_other_id.text = self._prepare_field( + cr, uid, identification_label, identification, eval_ctx, + gen_args=gen_args, context=context) + csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') + csi_scheme_name_proprietary = etree.SubElement( + csi_scheme_name, 'Prtry') + csi_scheme_name_proprietary.text = scheme_name_proprietary + return True diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py new file mode 100644 index 000000000..222786c27 --- /dev/null +++ b/account_banking_pain_base/company.py @@ -0,0 +1,82 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Copyright (C) 2013 Noviat (http://www.noviat.com) +# @author: Alexis de Lattre +# @author: Luc de Meyer (Noviat) +# +# 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.osv import orm, fields + + +class res_company(orm.Model): + _inherit = 'res.company' + + _columns = { + 'initiating_party_issuer': fields.char( + 'Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by OpenERP."), + } + + def _get_initiating_party_identifier( + self, cr, uid, company_id, context=None): + '''The code here may be different from one country to another. + If you need to add support for an additionnal country, you can + contribute your code here or inherit this function in the + localization modules for your country''' + assert isinstance(company_id, int), 'Only one company ID' + company = self.browse(cr, uid, company_id, context=context) + company_vat = company.vat + party_identifier = False + if company_vat: + country_code = company_vat[0:2].upper() + if country_code == 'BE': + party_identifier = company_vat[2:].replace(' ', '') + elif country_code == 'ES': + party_identifier = company.sepa_creditor_identifier + return party_identifier + + def _initiating_party_issuer_default(self, cr, uid, context=None): + '''If you need to add support for an additionnal country, you can + add an entry in the dict "party_issuer_per_country" here + or inherit this function in the localization modules for + your country''' + initiating_party_issuer = '' + # If your country require the 'Initiating Party Issuer', you should + # contribute the entry for your country in the dict below + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + company_id = self._company_default_get( + cr, uid, 'res.company', context=context) + if company_id: + company = self.browse(cr, uid, company_id, context=context) + country_code = company.country_id.code + initiating_party_issuer = party_issuer_per_country.get( + country_code, '') + return initiating_party_issuer + + def _initiating_party_issuer_def(self, cr, uid, context=None): + return self._initiating_party_issuer_default( + cr, uid, context=context) + + _defaults = { + 'initiating_party_issuer': _initiating_party_issuer_def, + } diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml new file mode 100644 index 000000000..a98d9b641 --- /dev/null +++ b/account_banking_pain_base/company_view.xml @@ -0,0 +1,24 @@ + + + + + + + pain.group.on.res.company.form + res.company + + + + + + + + + + + + diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot new file mode 100644 index 000000000..d4a7dbac5 --- /dev/null +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -0,0 +1,146 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2013-12-23 21:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "" + diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po new file mode 100644 index 000000000..e58b8ece0 --- /dev/null +++ b/account_banking_pain_base/i18n/fr.po @@ -0,0 +1,172 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-01 04:48+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma " +"XML officiel. Le fichier XML généré et le message d'erreur complet ont été " +"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " +"une idée sur la cause du problème : %s" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Priorité" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Ligne de paiement" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Mode de paiement" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés " +"par OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Le 'Type de communication structuré' n'est pas renseigné sur la ligne de " +"paiement ayant la référence '%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" +"Impossible de calculer le '%s' de la ligne de paiement ayant la référence " +"'%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Impossible de calculer le '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" +"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Erreur :" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Cet IBAN n'est pas valide : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Erreur dans le type de champ :" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Type de communication structurée" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Si actif, OpenERP convertira chaque caractère accentué en son équivalent non " +"accentué, de telle façon que seuls des caractères ASCII soient utilisés dans " +"le fichier PAIN généré." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." +msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Élevé" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Convertir en ASCII" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po new file mode 100644 index 000000000..721d24f68 --- /dev/null +++ b/account_banking_pain_base/i18n/nl.po @@ -0,0 +1,172 @@ +# Dutch translation for banking-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the banking-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: banking-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-11 08:32+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema " +"definities. Het gegenereerde XML bestand en de volledige fout zijn " +"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee " +"kunt geven over de oorzaak van het probleem: %s\"" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Prioriteit" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Betaalregel" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Betaalwijze" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Dit wordt gebruikt als de 'Initiating Party Issuer' in de PAIN bestanden " +"gegenereerd door OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Ontbrekende 'Structured Communication Type' op betaalregel met referentie " +"'%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normaal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Kan de '%s' niet berekenen." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Fout:" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Deze IBAN is niet geldig : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Veld type fout:" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Structured Communication Type" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Indien aangevinkt, zal OpenERP elk geaccentueerde karakter omzetten in een " +"overeenkomstige ongeaccentueerde karakter, zodat alleen ASCII karakters " +"worden gebruikt in het gegenereerde PAIN bestand." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" +"Dit veld wordt gebruikt als de 'Instruction Priority' in het gegenereerde " +"PAIN bestand." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Hoog" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Converteer naar ASCII" diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py new file mode 100644 index 000000000..f1e6551bf --- /dev/null +++ b/account_banking_pain_base/models/__init__.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . import payment_line +from . import payment_mode +from . import res_company +from . import banking_export_pain diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py new file mode 100644 index 000000000..17961a29a --- /dev/null +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -0,0 +1,440 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm +from openerp.tools.translate import _ +from openerp.tools.safe_eval import safe_eval +from datetime import datetime +from unidecode import unidecode +from lxml import etree +from openerp import tools +import logging +import base64 + +logger = logging.getLogger(__name__) + + +class BankingExportPain(orm.AbstractModel): + _name = 'banking.export.pain' + + def _validate_iban(self, cr, uid, iban, context=None): + '''if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message''' + partner_bank_obj = self.pool.get('res.partner.bank') + if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): + return iban.replace(' ', '') + else: + raise orm.except_orm( + _('Error:'), _("This IBAN is not valid : %s") % iban) + + def _prepare_field(self, cr, uid, field_name, field_value, eval_ctx, + max_size=0, gen_args=None, context=None): + """This function is designed to be inherited !""" + if gen_args is None: + gen_args = {} + assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' + try: + value = safe_eval(field_value, eval_ctx) + # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters + # But we are dealing with banks... + # and many banks don't want non-ASCCI characters ! + # cf section 1.4 "Character set" of the SEPA Credit Transfer + # Scheme Customer-to-bank guidelines + if gen_args.get('convert_to_ascii'): + value = unidecode(value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') + except: + line = eval_ctx.get('line') + if line: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s' of the Payment Line with " + "reference '%s'.") + % (field_name, line.name)) + else: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s'.") % field_name) + if not isinstance(value, (str, unicode)): + raise orm.except_orm( + _('Field type error:'), + _("The type of the field '%s' is %s. It should be a string " + "or unicode.") + % (field_name, type(value))) + if not value: + raise orm.except_orm( + _('Error:'), + _("The '%s' is empty or 0. It should have a non-null value.") + % field_name) + if max_size and len(value) > max_size: + value = value[0:max_size] + return value + + def _prepare_export_sepa( + self, cr, uid, total_amount, transactions_count, xml_string, + gen_args, context=None): + return { + 'batch_booking': gen_args['sepa_export'].batch_booking, + 'charge_bearer': gen_args['sepa_export'].charge_bearer, + 'total_amount': total_amount, + 'nb_transactions': transactions_count, + 'file': base64.encodestring(xml_string), + 'payment_order_ids': [( + 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] + )], + } + + def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): + xsd_etree_obj = etree.parse( + tools.file_open(gen_args['pain_xsd_file'])) + official_pain_schema = etree.XMLSchema(xsd_etree_obj) + + try: + root_to_validate = etree.fromstring(xml_string) + official_pain_schema.assertValid(root_to_validate) + except Exception, e: + logger.warning( + "The XML file is invalid against the XML Schema Definition") + logger.warning(xml_string) + logger.warning(e) + raise orm.except_orm( + _('Error:'), + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. Here " + "is the error, which may give you an idea on the cause " + "of the problem : %s") + % str(e)) + return True + + def finalize_sepa_file_creation( + self, cr, uid, ids, xml_root, total_amount, transactions_count, + gen_args, context=None): + xml_string = etree.tostring( + xml_root, pretty_print=True, encoding='UTF-8', + xml_declaration=True) + logger.debug( + "Generated SEPA XML file in format %s below" + % gen_args['pain_flavor']) + logger.debug(xml_string) + self._validate_xml(cr, uid, xml_string, gen_args, context=context) + + file_id = gen_args['file_obj'].create( + cr, uid, self._prepare_export_sepa( + cr, uid, total_amount, transactions_count, + xml_string, gen_args, context=context), + context=context) + + self.write( + cr, uid, ids, { + 'file_id': file_id, + 'state': 'finish', + }, context=context) + + action = { + 'name': 'SEPA File', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': self._name, + 'res_id': ids[0], + 'target': 'new', + } + return action + + def generate_group_header_block( + self, cr, uid, parent_node, gen_args, context=None): + group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') + message_identification_1_1 = etree.SubElement( + group_header_1_0, 'MsgId') + message_identification_1_1.text = self._prepare_field( + cr, uid, 'Message Identification', + 'sepa_export.payment_order_ids[0].reference', + {'sepa_export': gen_args['sepa_export']}, 35, + gen_args=gen_args, context=context) + creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') + creation_date_time_1_2.text = datetime.strftime( + datetime.today(), '%Y-%m-%dT%H:%M:%S') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + # batch_booking is in "Group header" with pain.001.001.02 + # and in "Payment info" in pain.001.001.03/04 + batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + nb_of_transactions_1_6 = etree.SubElement( + group_header_1_0, 'NbOfTxs') + control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + # Grpg removed in pain.001.001.03 + if gen_args.get('pain_flavor') == 'pain.001.001.02': + grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping.text = 'GRPD' + self.generate_initiating_party_block( + cr, uid, group_header_1_0, gen_args, + context=context) + return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + + def generate_start_payment_info_block( + self, cr, uid, parent_node, payment_info_ident, + priority, local_instrument, sequence_type, requested_date, + eval_ctx, gen_args, context=None): + payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification_2_1 = etree.SubElement( + payment_info_2_0, 'PmtInfId') + payment_info_identification_2_1.text = self._prepare_field( + cr, uid, 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, + gen_args=gen_args, context=context) + payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') + payment_method_2_2.text = gen_args['payment_method'] + nb_of_transactions_2_4 = False + control_sum_2_5 = False + if gen_args.get('pain_flavor') != 'pain.001.001.02': + batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') + batch_booking_2_3.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + # The "SEPA Customer-to-bank + # Implementation guidelines" for SCT and SDD says that control sum + # and nb_of_transactions should be present + # at both "group header" level and "payment info" level + nb_of_transactions_2_4 = etree.SubElement( + payment_info_2_0, 'NbOfTxs') + 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: + instruction_priority_2_7 = etree.SubElement( + payment_type_info_2_6, 'InstrPrty') + instruction_priority_2_7.text = priority + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' + if local_instrument: + local_instrument_2_11 = etree.SubElement( + payment_type_info_2_6, 'LclInstrm') + local_instr_code_2_12 = etree.SubElement( + local_instrument_2_11, 'Cd') + local_instr_code_2_12.text = local_instrument + if sequence_type: + sequence_type_2_14 = etree.SubElement( + payment_type_info_2_6, 'SeqTp') + sequence_type_2_14.text = sequence_type + + if gen_args['payment_method'] == 'DD': + request_date_tag = 'ReqdColltnDt' + else: + request_date_tag = 'ReqdExctnDt' + requested_date_2_17 = etree.SubElement( + payment_info_2_0, request_date_tag) + requested_date_2_17.text = requested_date + return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + + def generate_initiating_party_block( + self, cr, uid, parent_node, gen_args, context=None): + my_company_name = self._prepare_field( + cr, uid, 'Company Name', + 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', + {'sepa_export': gen_args['sepa_export']}, + gen_args.get('name_maxsize'), gen_args=gen_args, context=context) + initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party_name.text = my_company_name + initiating_party_identifier = self.pool['res.company'].\ + _get_initiating_party_identifier( + cr, uid, + gen_args['sepa_export'].payment_order_ids[0].company_id.id, + context=context) + initiating_party_issuer = gen_args['sepa_export'].\ + payment_order_ids[0].company_id.initiating_party_issuer + if initiating_party_identifier and initiating_party_issuer: + iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') + iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') + iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') + iniparty_org_other_id.text = initiating_party_identifier + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer + return True + + def generate_party_agent( + self, cr, uid, parent_node, party_type, party_type_label, + order, party_name, iban, bic, eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + try: + bic = self._prepare_field( + cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, + gen_args=gen_args, context=context) + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = bic + except orm.except_orm: + if order == 'C': + if iban[0:2] != gen_args['initiating_party_country_code']: + raise orm.except_orm( + _('Error:'), + _("The bank account with IBAN '%s' of partner '%s' " + "must have an associated BIC because it is a " + "cross-border SEPA operation.") + % (iban, party_name)) + if order == 'B' or ( + order == 'C' and gen_args['payment_method'] == 'DD'): + party_agent = etree.SubElement( + parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' + # for Credit Transfers, in the 'C' block, if BIC is not provided, + # we should not put the 'Creditor Agent' block at all, + # as per the guidelines of the EPC + return True + + def generate_party_block( + self, cr, uid, parent_node, party_type, order, name, iban, bic, + eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if party_type == 'Cdtr': + party_type_label = 'Creditor' + elif party_type == 'Dbtr': + party_type_label = 'Debtor' + party_name = self._prepare_field( + cr, uid, '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), + gen_args=gen_args, context=context) + piban = self._prepare_field( + cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, + gen_args=gen_args, + context=context) + viban = self._validate_iban(cr, uid, piban, context=context) + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'B': + gen_args['initiating_party_country_code'] = viban[0:2] + elif order == 'C': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + party = etree.SubElement(parent_node, party_type) + party_nm = etree.SubElement(party, 'Nm') + party_nm.text = party_name + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = viban + if order == 'B': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + return True + + def generate_remittance_info_block( + self, cr, uid, parent_node, line, gen_args, context=None): + + remittance_info_2_91 = etree.SubElement( + parent_node, 'RmtInf') + if line.state == 'normal': + remittance_info_unstructured_2_99 = etree.SubElement( + remittance_info_2_91, 'Ustrd') + remittance_info_unstructured_2_99.text = \ + self._prepare_field( + cr, uid, 'Remittance Unstructured Information', + 'line.communication', {'line': line}, 140, + gen_args=gen_args, + context=context) + else: + if not line.struct_communication_type: + raise orm.except_orm( + _('Error:'), + _("Missing 'Structured Communication Type' on payment " + "line with reference '%s'.") + % (line.name)) + remittance_info_structured_2_100 = etree.SubElement( + remittance_info_2_91, 'Strd') + creditor_ref_information_2_120 = etree.SubElement( + remittance_info_structured_2_100, 'CdtrRefInf') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRefTp') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_2_121, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRef') + else: + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'Tp') + creditor_ref_info_type_or_2_122 = etree.SubElement( + creditor_ref_info_type_2_121, 'CdOrPrtry') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_or_2_122, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'Ref') + + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125.text = \ + line.struct_communication_type + creditor_reference_2_126.text = \ + self._prepare_field( + cr, uid, 'Creditor Structured Reference', + 'line.communication', {'line': line}, 35, + gen_args=gen_args, + context=context) + return True + + def generate_creditor_scheme_identification( + self, cr, uid, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args, context=None): + csi_id = etree.SubElement( + parent_node, 'Id') + csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_other = etree.SubElement(csi_privateid, 'Othr') + csi_other_id = etree.SubElement(csi_other, 'Id') + csi_other_id.text = self._prepare_field( + cr, uid, identification_label, identification, eval_ctx, + gen_args=gen_args, context=context) + csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') + csi_scheme_name_proprietary = etree.SubElement( + csi_scheme_name, 'Prtry') + csi_scheme_name_proprietary.text = scheme_name_proprietary + return True diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py new file mode 100644 index 000000000..0dffbcf42 --- /dev/null +++ b/account_banking_pain_base/models/payment_line.py @@ -0,0 +1,52 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_line(orm.Model): + _inherit = 'payment.line' + + def _get_struct_communication_types(self, cr, uid, context=None): + return [('ISO', 'ISO')] + + _columns = { + 'priority': fields.selection([ + ('NORM', 'Normal'), + ('HIGH', 'High'), + ], 'Priority', + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file."), + # Update size from 64 to 140, because PAIN allows 140 caracters + 'communication': fields.char( + 'Communication', size=140, required=True, + help="Used as the message between ordering customer and current " + "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'), + } + + _defaults = { + 'priority': 'NORM', + 'struct_communication_type': 'ISO', + } diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/payment_mode.py new file mode 100644 index 000000000..540d01b67 --- /dev/null +++ b/account_banking_pain_base/models/payment_mode.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_mode(orm.Model): + _inherit = 'payment.mode' + + _columns = { + 'convert_to_ascii': fields.boolean( + 'Convert to ASCII', + help="If active, OpenERP will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file."), + } + + _defaults = { + 'convert_to_ascii': True, + } diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py new file mode 100644 index 000000000..f63efc29e --- /dev/null +++ b/account_banking_pain_base/models/res_company.py @@ -0,0 +1,82 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Copyright (C) 2013 Noviat (http://www.noviat.com) +# @author: Alexis de Lattre +# @author: Luc de Meyer (Noviat) +# +# 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.osv import orm, fields + + +class ResCompany(orm.Model): + _inherit = 'res.company' + + _columns = { + 'initiating_party_issuer': fields.char( + 'Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by OpenERP."), + } + + def _get_initiating_party_identifier( + self, cr, uid, company_id, context=None): + """The code here may be different from one country to another. + If you need to add support for an additionnal country, you can + contribute your code here or inherit this function in the + localization modules for your country""" + assert isinstance(company_id, int), 'Only one company ID' + company = self.browse(cr, uid, company_id, context=context) + company_vat = company.vat + party_identifier = False + if company_vat: + country_code = company_vat[0:2].upper() + if country_code == 'BE': + party_identifier = company_vat[2:].replace(' ', '') + elif country_code == 'ES': + party_identifier = company.sepa_creditor_identifier + return party_identifier + + def _initiating_party_issuer_default(self, cr, uid, context=None): + """If you need to add support for an additionnal country, you can + add an entry in the dict "party_issuer_per_country" here + or inherit this function in the localization modules for + your country""" + initiating_party_issuer = '' + # If your country require the 'Initiating Party Issuer', you should + # contribute the entry for your country in the dict below + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + company_id = self._company_default_get( + cr, uid, 'res.company', context=context) + if company_id: + company = self.browse(cr, uid, company_id, context=context) + country_code = company.country_id.code + initiating_party_issuer = party_issuer_per_country.get( + country_code, '') + return initiating_party_issuer + + def _initiating_party_issuer_def(self, cr, uid, context=None): + return self._initiating_party_issuer_default( + cr, uid, context=context) + + _defaults = { + 'initiating_party_issuer': _initiating_party_issuer_def, + } diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py new file mode 100644 index 000000000..0dffbcf42 --- /dev/null +++ b/account_banking_pain_base/payment_line.py @@ -0,0 +1,52 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_line(orm.Model): + _inherit = 'payment.line' + + def _get_struct_communication_types(self, cr, uid, context=None): + return [('ISO', 'ISO')] + + _columns = { + 'priority': fields.selection([ + ('NORM', 'Normal'), + ('HIGH', 'High'), + ], 'Priority', + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file."), + # Update size from 64 to 140, because PAIN allows 140 caracters + 'communication': fields.char( + 'Communication', size=140, required=True, + help="Used as the message between ordering customer and current " + "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'), + } + + _defaults = { + 'priority': 'NORM', + 'struct_communication_type': 'ISO', + } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml new file mode 100644 index 000000000..f92b1bbf5 --- /dev/null +++ b/account_banking_pain_base/payment_line_view.xml @@ -0,0 +1,41 @@ + + + + + + + pain.base.payment.line.form + payment.line + + + + + + + + + + + + + + pain.base.payment.line.inside.order.form + payment.order + + + + + + + + + + + + + + diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py new file mode 100644 index 000000000..540d01b67 --- /dev/null +++ b/account_banking_pain_base/payment_mode.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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.osv import orm, fields + + +class payment_mode(orm.Model): + _inherit = 'payment.mode' + + _columns = { + 'convert_to_ascii': fields.boolean( + 'Convert to ASCII', + help="If active, OpenERP will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file."), + } + + _defaults = { + 'convert_to_ascii': True, + } diff --git a/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/payment_mode_view.xml new file mode 100644 index 000000000..2deb24999 --- /dev/null +++ b/account_banking_pain_base/payment_mode_view.xml @@ -0,0 +1,22 @@ + + + + + + + add.convert_to_ascii.in.payment.mode.form + payment.mode + + + + + + + + + + diff --git a/account_banking_pain_base/views/payment_line_view.xml b/account_banking_pain_base/views/payment_line_view.xml new file mode 100644 index 000000000..f92b1bbf5 --- /dev/null +++ b/account_banking_pain_base/views/payment_line_view.xml @@ -0,0 +1,41 @@ + + + + + + + pain.base.payment.line.form + payment.line + + + + + + + + + + + + + + pain.base.payment.line.inside.order.form + payment.order + + + + + + + + + + + + + + diff --git a/account_banking_pain_base/views/payment_mode_view.xml b/account_banking_pain_base/views/payment_mode_view.xml new file mode 100644 index 000000000..2deb24999 --- /dev/null +++ b/account_banking_pain_base/views/payment_mode_view.xml @@ -0,0 +1,22 @@ + + + + + + + add.convert_to_ascii.in.payment.mode.form + payment.mode + + + + + + + + + + diff --git a/account_banking_pain_base/views/res_company_view.xml b/account_banking_pain_base/views/res_company_view.xml new file mode 100644 index 000000000..a98d9b641 --- /dev/null +++ b/account_banking_pain_base/views/res_company_view.xml @@ -0,0 +1,24 @@ + + + + + + + pain.group.on.res.company.form + res.company + + + + + + + + + + + + From 074c85d9f3edeb8bb74010e0f472eb1c1ba2024e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 7 Oct 2014 00:09:26 +0200 Subject: [PATCH 23/79] Clean files --- .../banking_export_pain.py | 439 ------------------ account_banking_pain_base/company.py | 82 ---- account_banking_pain_base/company_view.xml | 24 - account_banking_pain_base/payment_line.py | 52 --- .../payment_line_view.xml | 41 -- account_banking_pain_base/payment_mode.py | 39 -- .../payment_mode_view.xml | 22 - 7 files changed, 699 deletions(-) delete mode 100644 account_banking_pain_base/banking_export_pain.py delete mode 100644 account_banking_pain_base/company.py delete mode 100644 account_banking_pain_base/company_view.xml delete mode 100644 account_banking_pain_base/payment_line.py delete mode 100644 account_banking_pain_base/payment_line_view.xml delete mode 100644 account_banking_pain_base/payment_mode.py delete mode 100644 account_banking_pain_base/payment_mode_view.xml diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py deleted file mode 100644 index 279dc5f5a..000000000 --- a/account_banking_pain_base/banking_export_pain.py +++ /dev/null @@ -1,439 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm -from openerp.tools.translate import _ -from openerp.tools.safe_eval import safe_eval -from datetime import datetime -from unidecode import unidecode -from lxml import etree -from openerp import tools -import logging -import base64 - -logger = logging.getLogger(__name__) - - -class banking_export_pain(orm.AbstractModel): - _name = 'banking.export.pain' - - def _validate_iban(self, cr, uid, iban, context=None): - '''if IBAN is valid, returns IBAN - if IBAN is NOT valid, raises an error message''' - partner_bank_obj = self.pool.get('res.partner.bank') - if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): - return iban.replace(' ', '') - else: - raise orm.except_orm( - _('Error:'), _("This IBAN is not valid : %s") % iban) - - def _prepare_field( - self, cr, uid, field_name, field_value, eval_ctx, max_size=0, - gen_args=None, context=None): - '''This function is designed to be inherited !''' - if gen_args is None: - gen_args = {} - assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' - try: - value = safe_eval(field_value, eval_ctx) - # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters - # But we are dealing with banks... - # and many banks don't want non-ASCCI characters ! - # cf section 1.4 "Character set" of the SEPA Credit Transfer - # Scheme Customer-to-bank guidelines - if gen_args.get('convert_to_ascii'): - value = unidecode(value) - unallowed_ascii_chars = [ - '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', - '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] - for unallowed_ascii_char in unallowed_ascii_chars: - value = value.replace(unallowed_ascii_char, '-') - except: - line = eval_ctx.get('line') - if line: - raise orm.except_orm( - _('Error:'), - _("Cannot compute the '%s' of the Payment Line with " - "reference '%s'.") - % (field_name, line.name)) - else: - raise orm.except_orm( - _('Error:'), - _("Cannot compute the '%s'.") % field_name) - if not isinstance(value, (str, unicode)): - raise orm.except_orm( - _('Field type error:'), - _("The type of the field '%s' is %s. It should be a string " - "or unicode.") - % (field_name, type(value))) - if not value: - raise orm.except_orm( - _('Error:'), - _("The '%s' is empty or 0. It should have a non-null value.") - % field_name) - if max_size and len(value) > max_size: - value = value[0:max_size] - return value - - def _prepare_export_sepa( - self, cr, uid, total_amount, transactions_count, xml_string, - gen_args, context=None): - return { - 'batch_booking': gen_args['sepa_export'].batch_booking, - 'charge_bearer': gen_args['sepa_export'].charge_bearer, - 'total_amount': total_amount, - 'nb_transactions': transactions_count, - 'file': base64.encodestring(xml_string), - 'payment_order_ids': [( - 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] - )], - } - - def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): - xsd_etree_obj = etree.parse( - tools.file_open(gen_args['pain_xsd_file'])) - official_pain_schema = etree.XMLSchema(xsd_etree_obj) - - try: - root_to_validate = etree.fromstring(xml_string) - official_pain_schema.assertValid(root_to_validate) - except Exception, e: - logger.warning( - "The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) - logger.warning(e) - raise orm.except_orm( - _('Error:'), - _("The generated XML file is not valid against the official " - "XML Schema Definition. The generated XML file and the " - "full error have been written in the server logs. Here " - "is the error, which may give you an idea on the cause " - "of the problem : %s") - % str(e)) - return True - - def finalize_sepa_file_creation( - self, cr, uid, ids, xml_root, total_amount, transactions_count, - gen_args, context=None): - xml_string = etree.tostring( - xml_root, pretty_print=True, encoding='UTF-8', - xml_declaration=True) - logger.debug( - "Generated SEPA XML file in format %s below" - % gen_args['pain_flavor']) - logger.debug(xml_string) - self._validate_xml(cr, uid, xml_string, gen_args, context=context) - - file_id = gen_args['file_obj'].create( - cr, uid, self._prepare_export_sepa( - cr, uid, total_amount, transactions_count, - xml_string, gen_args, context=context), - context=context) - - self.write( - cr, uid, ids, { - 'file_id': file_id, - 'state': 'finish', - }, context=context) - - action = { - 'name': 'SEPA File', - 'type': 'ir.actions.act_window', - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': self._name, - 'res_id': ids[0], - 'target': 'new', - } - return action - - def generate_group_header_block( - self, cr, uid, parent_node, gen_args, context=None): - group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') - message_identification_1_1 = etree.SubElement( - group_header_1_0, 'MsgId') - message_identification_1_1.text = self._prepare_field( - cr, uid, 'Message Identification', - 'sepa_export.payment_order_ids[0].reference', - {'sepa_export': gen_args['sepa_export']}, 35, - gen_args=gen_args, context=context) - creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') - creation_date_time_1_2.text = datetime.strftime( - datetime.today(), '%Y-%m-%dT%H:%M:%S') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - # batch_booking is in "Group header" with pain.001.001.02 - # and in "Payment info" in pain.001.001.03/04 - batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') - batch_booking.text = \ - str(gen_args['sepa_export'].batch_booking).lower() - nb_of_transactions_1_6 = etree.SubElement( - group_header_1_0, 'NbOfTxs') - control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') - # Grpg removed in pain.001.001.03 - if gen_args.get('pain_flavor') == 'pain.001.001.02': - grouping = etree.SubElement(group_header_1_0, 'Grpg') - grouping.text = 'GRPD' - self.generate_initiating_party_block( - cr, uid, group_header_1_0, gen_args, - context=context) - return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 - - def generate_start_payment_info_block( - self, cr, uid, parent_node, payment_info_ident, - priority, local_instrument, sequence_type, requested_date, - eval_ctx, gen_args, context=None): - payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') - payment_info_identification_2_1 = etree.SubElement( - payment_info_2_0, 'PmtInfId') - payment_info_identification_2_1.text = self._prepare_field( - cr, uid, 'Payment Information Identification', - payment_info_ident, eval_ctx, 35, - gen_args=gen_args, context=context) - payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') - payment_method_2_2.text = gen_args['payment_method'] - if gen_args.get('pain_flavor') != 'pain.001.001.02': - batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = \ - str(gen_args['sepa_export'].batch_booking).lower() - # The "SEPA Customer-to-bank - # Implementation guidelines" for SCT and SDD says that control sum - # and nb_of_transactions should be present - # at both "group header" level and "payment info" level - nb_of_transactions_2_4 = etree.SubElement( - payment_info_2_0, 'NbOfTxs') - 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: - instruction_priority_2_7 = etree.SubElement( - payment_type_info_2_6, 'InstrPrty') - instruction_priority_2_7.text = priority - service_level_2_8 = etree.SubElement( - payment_type_info_2_6, 'SvcLvl') - service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') - service_level_code_2_9.text = 'SEPA' - if local_instrument: - local_instrument_2_11 = etree.SubElement( - payment_type_info_2_6, 'LclInstrm') - local_instr_code_2_12 = etree.SubElement( - local_instrument_2_11, 'Cd') - local_instr_code_2_12.text = local_instrument - if sequence_type: - sequence_type_2_14 = etree.SubElement( - payment_type_info_2_6, 'SeqTp') - sequence_type_2_14.text = sequence_type - - if gen_args['payment_method'] == 'DD': - request_date_tag = 'ReqdColltnDt' - else: - request_date_tag = 'ReqdExctnDt' - requested_date_2_17 = etree.SubElement( - payment_info_2_0, request_date_tag) - requested_date_2_17.text = requested_date - return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 - - def generate_initiating_party_block( - self, cr, uid, parent_node, gen_args, context=None): - my_company_name = self._prepare_field( - cr, uid, 'Company Name', - 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', - {'sepa_export': gen_args['sepa_export']}, - gen_args.get('name_maxsize'), gen_args=gen_args, context=context) - initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') - initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') - initiating_party_name.text = my_company_name - initiating_party_identifier = self.pool['res.company'].\ - _get_initiating_party_identifier( - cr, uid, - gen_args['sepa_export'].payment_order_ids[0].company_id.id, - context=context) - initiating_party_issuer = gen_args['sepa_export'].\ - payment_order_ids[0].company_id.initiating_party_issuer - if initiating_party_identifier and initiating_party_issuer: - iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') - iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') - iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') - iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') - iniparty_org_other_id.text = initiating_party_identifier - iniparty_org_other_issuer = etree.SubElement( - iniparty_org_other, 'Issr') - iniparty_org_other_issuer.text = initiating_party_issuer - return True - - def generate_party_agent( - self, cr, uid, parent_node, party_type, party_type_label, - order, party_name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD''' - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - try: - bic = self._prepare_field( - cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, - gen_args=gen_args, context=context) - party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_bic = etree.SubElement( - party_agent_institution, gen_args.get('bic_xml_tag')) - party_agent_bic.text = bic - except orm.except_orm: - if order == 'C': - if iban[0:2] != gen_args['initiating_party_country_code']: - raise orm.except_orm( - _('Error:'), - _("The bank account with IBAN '%s' of partner '%s' " - "must have an associated BIC because it is a " - "cross-border SEPA operation.") - % (iban, party_name)) - if order == 'B' or ( - order == 'C' and gen_args['payment_method'] == 'DD'): - party_agent = etree.SubElement( - parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_other = etree.SubElement( - party_agent_institution, 'Othr') - party_agent_other_identification = etree.SubElement( - party_agent_other, 'Id') - party_agent_other_identification.text = 'NOTPROVIDED' - # for Credit Transfers, in the 'C' block, if BIC is not provided, - # we should not put the 'Creditor Agent' block at all, - # as per the guidelines of the EPC - return True - - def generate_party_block( - self, cr, uid, parent_node, party_type, order, name, iban, bic, - eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD''' - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - if party_type == 'Cdtr': - party_type_label = 'Creditor' - elif party_type == 'Dbtr': - party_type_label = 'Debtor' - party_name = self._prepare_field( - cr, uid, '%s Name' % party_type_label, name, eval_ctx, - gen_args.get('name_maxsize'), - gen_args=gen_args, context=context) - piban = self._prepare_field( - cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, - gen_args=gen_args, - context=context) - viban = self._validate_iban(cr, uid, piban, context=context) - # At C level, the order is : BIC, Name, IBAN - # At B level, the order is : Name, IBAN, BIC - if order == 'B': - gen_args['initiating_party_country_code'] = viban[0:2] - elif order == 'C': - self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) - party = etree.SubElement(parent_node, party_type) - party_nm = etree.SubElement(party, 'Nm') - party_nm.text = party_name - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') - party_account_iban.text = viban - if order == 'B': - self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) - return True - - def generate_remittance_info_block( - self, cr, uid, parent_node, line, gen_args, context=None): - - remittance_info_2_91 = etree.SubElement( - parent_node, 'RmtInf') - if line.state == 'normal': - remittance_info_unstructured_2_99 = etree.SubElement( - remittance_info_2_91, 'Ustrd') - remittance_info_unstructured_2_99.text = \ - self._prepare_field( - cr, uid, 'Remittance Unstructured Information', - 'line.communication', {'line': line}, 140, - gen_args=gen_args, - context=context) - else: - if not line.struct_communication_type: - raise orm.except_orm( - _('Error:'), - _("Missing 'Structured Communication Type' on payment " - "line with reference '%s'.") - % (line.name)) - remittance_info_structured_2_100 = etree.SubElement( - remittance_info_2_91, 'Strd') - creditor_ref_information_2_120 = etree.SubElement( - remittance_info_structured_2_100, 'CdtrRefInf') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRefTp') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_2_121, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRef') - else: - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'Tp') - creditor_ref_info_type_or_2_122 = etree.SubElement( - creditor_ref_info_type_2_121, 'CdOrPrtry') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_or_2_122, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'Ref') - - creditor_ref_info_type_code_2_123.text = 'SCOR' - creditor_ref_info_type_issuer_2_125.text = \ - line.struct_communication_type - creditor_reference_2_126.text = \ - self._prepare_field( - cr, uid, 'Creditor Structured Reference', - 'line.communication', {'line': line}, 35, - gen_args=gen_args, - context=context) - return True - - def generate_creditor_scheme_identification( - self, cr, uid, parent_node, identification, identification_label, - eval_ctx, scheme_name_proprietary, gen_args, context=None): - csi_id = etree.SubElement( - parent_node, 'Id') - csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') - csi_other = etree.SubElement(csi_privateid, 'Othr') - csi_other_id = etree.SubElement(csi_other, 'Id') - csi_other_id.text = self._prepare_field( - cr, uid, identification_label, identification, eval_ctx, - gen_args=gen_args, context=context) - csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') - csi_scheme_name_proprietary = etree.SubElement( - csi_scheme_name, 'Prtry') - csi_scheme_name_proprietary.text = scheme_name_proprietary - return True diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py deleted file mode 100644 index 222786c27..000000000 --- a/account_banking_pain_base/company.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# Copyright (C) 2013 Noviat (http://www.noviat.com) -# @author: Alexis de Lattre -# @author: Luc de Meyer (Noviat) -# -# 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.osv import orm, fields - - -class res_company(orm.Model): - _inherit = 'res.company' - - _columns = { - 'initiating_party_issuer': fields.char( - 'Initiating Party Issuer', size=35, - help="This will be used as the 'Initiating Party Issuer' in the " - "PAIN files generated by OpenERP."), - } - - def _get_initiating_party_identifier( - self, cr, uid, company_id, context=None): - '''The code here may be different from one country to another. - If you need to add support for an additionnal country, you can - contribute your code here or inherit this function in the - localization modules for your country''' - assert isinstance(company_id, int), 'Only one company ID' - company = self.browse(cr, uid, company_id, context=context) - company_vat = company.vat - party_identifier = False - if company_vat: - country_code = company_vat[0:2].upper() - if country_code == 'BE': - party_identifier = company_vat[2:].replace(' ', '') - elif country_code == 'ES': - party_identifier = company.sepa_creditor_identifier - return party_identifier - - def _initiating_party_issuer_default(self, cr, uid, context=None): - '''If you need to add support for an additionnal country, you can - add an entry in the dict "party_issuer_per_country" here - or inherit this function in the localization modules for - your country''' - initiating_party_issuer = '' - # If your country require the 'Initiating Party Issuer', you should - # contribute the entry for your country in the dict below - party_issuer_per_country = { - 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium - } - company_id = self._company_default_get( - cr, uid, 'res.company', context=context) - if company_id: - company = self.browse(cr, uid, company_id, context=context) - country_code = company.country_id.code - initiating_party_issuer = party_issuer_per_country.get( - country_code, '') - return initiating_party_issuer - - def _initiating_party_issuer_def(self, cr, uid, context=None): - return self._initiating_party_issuer_default( - cr, uid, context=context) - - _defaults = { - 'initiating_party_issuer': _initiating_party_issuer_def, - } diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml deleted file mode 100644 index a98d9b641..000000000 --- a/account_banking_pain_base/company_view.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - pain.group.on.res.company.form - res.company - - - - - - - - - - - - diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py deleted file mode 100644 index 0dffbcf42..000000000 --- a/account_banking_pain_base/payment_line.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm, fields - - -class payment_line(orm.Model): - _inherit = 'payment.line' - - def _get_struct_communication_types(self, cr, uid, context=None): - return [('ISO', 'ISO')] - - _columns = { - 'priority': fields.selection([ - ('NORM', 'Normal'), - ('HIGH', 'High'), - ], 'Priority', - help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file."), - # Update size from 64 to 140, because PAIN allows 140 caracters - 'communication': fields.char( - 'Communication', size=140, required=True, - help="Used as the message between ordering customer and current " - "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'), - } - - _defaults = { - 'priority': 'NORM', - 'struct_communication_type': 'ISO', - } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml deleted file mode 100644 index f92b1bbf5..000000000 --- a/account_banking_pain_base/payment_line_view.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - pain.base.payment.line.form - payment.line - - - - - - - - - - - - - - pain.base.payment.line.inside.order.form - payment.order - - - - - - - - - - - - - - diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py deleted file mode 100644 index 540d01b67..000000000 --- a/account_banking_pain_base/payment_mode.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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.osv import orm, fields - - -class payment_mode(orm.Model): - _inherit = 'payment.mode' - - _columns = { - 'convert_to_ascii': fields.boolean( - 'Convert to ASCII', - help="If active, OpenERP will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file."), - } - - _defaults = { - 'convert_to_ascii': True, - } diff --git a/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/payment_mode_view.xml deleted file mode 100644 index 2deb24999..000000000 --- a/account_banking_pain_base/payment_mode_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - add.convert_to_ascii.in.payment.mode.form - payment.mode - - - - - - - - - - From f69f5399538bf68d1449b1b20bf8ac26fcd92e27 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 21 Oct 2014 09:51:40 +0200 Subject: [PATCH 24/79] [FIX] Uncaught flake8 errors --- account_banking_pain_base/__openerp__.py | 2 +- .../models/banking_export_pain.py | 21 +++++++++---------- .../models/payment_line.py | 11 +++++----- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index e7b199213..0d8030dc6 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -31,7 +31,7 @@ 'depends': ['account_banking_payment_export'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], - }, + }, 'data': [ 'views/payment_line_view.xml', 'views/payment_mode_view.xml', diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 17961a29a..0a9e3713a 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -37,8 +37,8 @@ class BankingExportPain(orm.AbstractModel): _name = 'banking.export.pain' def _validate_iban(self, cr, uid, iban, context=None): - '''if IBAN is valid, returns IBAN - if IBAN is NOT valid, raises an error message''' + """if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message""" partner_bank_obj = self.pool.get('res.partner.bank') if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): return iban.replace(' ', '') @@ -162,7 +162,7 @@ class BankingExportPain(orm.AbstractModel): 'res_model': self._name, 'res_id': ids[0], 'target': 'new', - } + } return action def generate_group_header_block( @@ -283,8 +283,8 @@ class BankingExportPain(orm.AbstractModel): def generate_party_agent( self, cr, uid, parent_node, party_type, party_type_label, order, party_name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD''' + """Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" try: bic = self._prepare_field( @@ -324,8 +324,8 @@ class BankingExportPain(orm.AbstractModel): def generate_party_block( self, cr, uid, parent_node, party_type, order, name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD''' + """Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" if party_type == 'Cdtr': party_type_label = 'Creditor' @@ -385,7 +385,7 @@ class BankingExportPain(orm.AbstractModel): _('Error:'), _("Missing 'Structured Communication Type' on payment " "line with reference '%s'.") - % (line.name)) + % line.name) remittance_info_structured_2_100 = etree.SubElement( remittance_info_2_91, 'Strd') creditor_ref_information_2_120 = etree.SubElement( @@ -425,9 +425,8 @@ class BankingExportPain(orm.AbstractModel): def generate_creditor_scheme_identification( self, cr, uid, parent_node, identification, identification_label, eval_ctx, scheme_name_proprietary, gen_args, context=None): - csi_id = etree.SubElement( - parent_node, 'Id') - csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_id = etree.SubElement(parent_node, 'Id') + csi_privateid = etree.SubElement(csi_id, 'PrvtId') csi_other = etree.SubElement(csi_privateid, 'Othr') csi_other_id = etree.SubElement(csi_other, 'Id') csi_other_id.text = self._prepare_field( diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 0dffbcf42..0598710e1 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -23,19 +23,18 @@ from openerp.osv import orm, fields -class payment_line(orm.Model): +class PaymentLine(orm.Model): _inherit = 'payment.line' def _get_struct_communication_types(self, cr, uid, context=None): return [('ISO', 'ISO')] _columns = { - 'priority': fields.selection([ - ('NORM', 'Normal'), - ('HIGH', 'High'), - ], 'Priority', + 'priority': fields.selection( + [('NORM', 'Normal'), + ('HIGH', 'High')], 'Priority', help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file."), + "the generated PAIN file."), # Update size from 64 to 140, because PAIN allows 140 caracters 'communication': fields.char( 'Communication', size=140, required=True, From 94133f80d0482496a26b9316ca2c8434768f8d2e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 31 Oct 2014 23:54:24 +0100 Subject: [PATCH 25/79] [FIX] account_payment_sale_stock: Split for removing stock dependency on sale [DEL] Remove old translations templates [IMP] More reorder on folder structure --- .../i18n/account_banking_pain_base.pot | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot deleted file mode 100644 index d4a7dbac5..000000000 --- a/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ /dev/null @@ -1,146 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2013-12-23 21:26+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "" - From 920ff73e7284e8e9997027dbcd24613b5ecd320a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 1 Nov 2014 01:48:26 +0100 Subject: [PATCH 26/79] [IMP] Translation template files [IMP] Translations to spanish --- .../i18n/account_banking_pain_base.pot | 153 ++++++++++++++++++ account_banking_pain_base/i18n/es.po | 153 ++++++++++++++++++ .../models/payment_mode.py | 2 +- .../models/res_company.py | 2 +- 4 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot create mode 100644 account_banking_pain_base/i18n/es.po diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot new file mode 100644 index 000000000..3430bda2b --- /dev/null +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -0,0 +1,153 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:73 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:124 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:303 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:385 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:83 +#, python-format +msgid "Field type error:" +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: field:banking.export.pain,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: view:res.company:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304 +#, python-format +msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." +msgstr "" + diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po new file mode 100644 index 000000000..61fa1e0ba --- /dev/null +++ b/account_banking_pain_base/i18n/es.po @@ -0,0 +1,153 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "No se puede procesar el campo '%s'." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Convertir a ASCII" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:73 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:124 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:303 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:385 +#, python-format +msgid "Error:" +msgstr "Error:" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:83 +#, python-format +msgid "Field type error:" +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Alta" + +#. module: account_banking_pain_base +#: field:banking.export.pain,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado." + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Emisor de la transacción" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "Falta el campo 'Tipo de comunicación estructurada' en la línea de pago con referencia '%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: view:res.company:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Iniciación del pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Línea de pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Prioridad" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Tipo de comunicación estructurada" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304 +#, python-format +msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." +msgstr "La cuenta bancaria con IBAN '%s' de la empresa '%s' debe tener un BIC asociado, porque es una operación SEPA transfronteriza." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Este IBAN no es válido: %s" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado." + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." +msgstr "Este campo se usará como 'Emisor de la transacción' en los archivos PAIN generados por Odoo." + diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/payment_mode.py index 540d01b67..ff9254ca0 100644 --- a/account_banking_pain_base/models/payment_mode.py +++ b/account_banking_pain_base/models/payment_mode.py @@ -29,7 +29,7 @@ class payment_mode(orm.Model): _columns = { 'convert_to_ascii': fields.boolean( 'Convert to ASCII', - help="If active, OpenERP will convert each accented caracter to " + help="If active, Odoo will convert each accented caracter to " "the corresponding unaccented caracter, so that only ASCII " "caracters are used in the generated PAIN file."), } diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index f63efc29e..182327f8a 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -32,7 +32,7 @@ class ResCompany(orm.Model): 'initiating_party_issuer': fields.char( 'Initiating Party Issuer', size=35, help="This will be used as the 'Initiating Party Issuer' in the " - "PAIN files generated by OpenERP."), + "PAIN files generated by Odoo."), } def _get_initiating_party_identifier( From 5b4a5e343201871333db3aa8a76b07b22e1e71dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 14 Dec 2014 14:51:28 +0100 Subject: [PATCH 27/79] [IMP] sepa: make it easier to extend structured communication types --- account_banking_pain_base/models/payment_line.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 0598710e1..8e2cb5ec4 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -42,7 +42,9 @@ 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'), + lambda self, *args, **kwargs: + self._get_struct_communication_types(*args, **kwargs), + 'Structured Communication Type'), } _defaults = { From 96d2ba0318b4446bbe489e6cb68a5c1eed546d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 14 Dec 2014 19:44:50 +0100 Subject: [PATCH 28/79] [IMP] use new style to make selection extendable --- account_banking_pain_base/models/payment_line.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 8e2cb5ec4..872827b7b 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -42,8 +42,7 @@ class PaymentLine(orm.Model): "company. Depicts 'What do you want to say to the recipient " "about this order ?'"), 'struct_communication_type': fields.selection( - lambda self, *args, **kwargs: - self._get_struct_communication_types(*args, **kwargs), + '_get_struct_communication_types', 'Structured Communication Type'), } From f4f8e6c8f3bb2e1cc8b1af53b67fdd4e34420b5b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 31 Dec 2014 13:43:02 +0100 Subject: [PATCH 29/79] [FIX] account_banking_pain_base: Set a general rule for the initiating party identifier --- account_banking_pain_base/models/res_company.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 182327f8a..2e5509de4 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -44,13 +44,11 @@ class ResCompany(orm.Model): assert isinstance(company_id, int), 'Only one company ID' company = self.browse(cr, uid, company_id, context=context) company_vat = company.vat - party_identifier = False - if company_vat: + party_identifier = company.sepa_creditor_identifier + if not party_identifier and company_vat: country_code = company_vat[0:2].upper() if country_code == 'BE': party_identifier = company_vat[2:].replace(' ', '') - elif country_code == 'ES': - party_identifier = company.sepa_creditor_identifier return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): From 1f312cdbc30e89dc715e1804ebe2bfa001fd7d24 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:23:15 +0100 Subject: [PATCH 30/79] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 0d8030dc6..a5f5a23da 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -24,7 +24,7 @@ 'summary': 'Base module for PAIN file generation', 'version': '0.1', 'license': 'AGPL-3', - 'author': 'Akretion, Noviat', + 'author': "Akretion, Noviat,Odoo Community Association (OCA)", 'website': 'http://openerp-community-association.org/', 'contributors': ['Pedro M. Baeza '], 'category': 'Hidden', From 2c05a79eb0627c31b435e87ec23fa0be4dfebdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 22 Jan 2015 17:46:23 +0100 Subject: [PATCH 31/79] [IMP] help text for bank and BIC fields Courtesy Alexis de Lattre --- account_banking_pain_base/models/__init__.py | 1 + .../models/res_partner_bank.py | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 account_banking_pain_base/models/res_partner_bank.py 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/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.") From c9c352bdd71e07454ca9b66bd633285726b13018 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Wed, 25 Mar 2015 09:11:12 +0100 Subject: [PATCH 32/79] protect import of external dependencies Odoo won't install an addon if the external dependencies are not met. However, the python modules of the addons are imported at startup, and the lack of an external dependency for an external addon will cause a crash, therefore the import needs to be in a try..except block. --- account_banking_pain_base/models/banking_export_pain.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 0a9e3713a..97ba21b8a 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -24,12 +24,17 @@ from openerp.osv import orm from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval from datetime import datetime -from unidecode import unidecode from lxml import etree from openerp import tools import logging import base64 + +try: + from unidecode import unidecode +except ImportError: + unidecode = None + logger = logging.getLogger(__name__) From 7a29f7a4746d507b6b045f17731c361eda81e520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 1 Apr 2015 22:06:21 +0200 Subject: [PATCH 33/79] [IMP] pain: do not use InstrPrty for Direct Debit --- account_banking_pain_base/models/banking_export_pain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 86dbfb48c8a7096163b0ee969011c27960d5f57e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 25 May 2015 17:14:05 +0200 Subject: [PATCH 34/79] [IMP] Expand authors + manifest cleaning --- account_banking_pain_base/__openerp__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index a5f5a23da..273c44438 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -24,8 +24,11 @@ 'summary': 'Base module for PAIN file generation', 'version': '0.1', 'license': 'AGPL-3', - 'author': "Akretion, Noviat,Odoo Community Association (OCA)", - 'website': 'http://openerp-community-association.org/', + 'author': "Akretion, " + "Noviat, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/bank-payment', 'contributors': ['Pedro M. Baeza '], 'category': 'Hidden', 'depends': ['account_banking_payment_export'], From 66d2242a02071da059ff919f55682d5091398732 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 29 Jan 2015 16:30:02 +0100 Subject: [PATCH 35/79] Use attachments instead of creating a specific object for each kind of payment order --- .../models/banking_export_pain.py | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index d1a178c72..8c0ed3fff 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -98,20 +98,6 @@ class BankingExportPain(orm.AbstractModel): value = value[0:max_size] return value - def _prepare_export_sepa( - self, cr, uid, total_amount, transactions_count, xml_string, - gen_args, context=None): - return { - 'batch_booking': gen_args['sepa_export'].batch_booking, - 'charge_bearer': gen_args['sepa_export'].charge_bearer, - 'total_amount': total_amount, - 'nb_transactions': transactions_count, - 'file': base64.encodestring(xml_string), - 'payment_order_ids': [( - 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] - )], - } - def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): xsd_etree_obj = etree.parse( tools.file_open(gen_args['pain_xsd_file'])) @@ -147,15 +133,18 @@ class BankingExportPain(orm.AbstractModel): logger.debug(xml_string) self._validate_xml(cr, uid, xml_string, gen_args, context=context) - file_id = gen_args['file_obj'].create( - cr, uid, self._prepare_export_sepa( - cr, uid, total_amount, transactions_count, - xml_string, gen_args, context=context), - context=context) + order_ref = [] + for order in gen_args['sepa_export'].payment_order_ids: + if order.reference: + order_ref.append(order.reference.replace('/', '-')) + filename = '%s%s.xml' % (gen_args['file_prefix'], '-'.join(order_ref)) self.write( cr, uid, ids, { - 'file_id': file_id, + 'nb_transactions': transactions_count, + 'total_amount': total_amount, + 'filename': filename, + 'file': base64.encodestring(xml_string), 'state': 'finish', }, context=context) From d2389709c3f6713a93caf19aef903d74a576683c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 1 Jun 2015 19:22:15 +0200 Subject: [PATCH 36/79] =?UTF-8?q?Fix=20bug=20#111=20New=20field=C2=A0initi?= =?UTF-8?q?ating=5Fparty=5Fidentifier=20on=20res.company=20(migration=20sc?= =?UTF-8?q?ript=20included)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account_banking_pain_base/__init__.py | 1 + account_banking_pain_base/__openerp__.py | 3 +- .../i18n/account_banking_pain_base.pot | 51 +++++++++------ .../migrations/8.0.0.2/post-migration.py | 30 +++++++++ .../models/banking_export_pain.py | 19 ++++-- .../models/res_company.py | 64 ++++--------------- account_banking_pain_base/post_install.py | 57 +++++++++++++++++ .../views/res_company_view.xml | 3 +- 8 files changed, 148 insertions(+), 80 deletions(-) create mode 100644 account_banking_pain_base/migrations/8.0.0.2/post-migration.py create mode 100644 account_banking_pain_base/post_install.py diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index b69a01a1b..49f1f9fc1 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -21,3 +21,4 @@ ############################################################################## from . import models +from post_install import set_default_initiating_party diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 273c44438..19aef3e38 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '0.1', + 'version': '0.2', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " @@ -40,6 +40,7 @@ 'views/payment_mode_view.xml', 'views/res_company_view.xml', ], + 'post_init_hook': 'set_default_initiating_party', 'description': ''' Base module for PAIN file generation ==================================== diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot index 3430bda2b..ec6637431 100644 --- a/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-31 22:52+0000\n" -"PO-Revision-Date: 2014-10-31 22:52+0000\n" +"POT-Creation-Date: 2015-06-01 17:20+0000\n" +"PO-Revision-Date: 2015-06-01 17:20+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,13 +16,18 @@ msgstr "" "Plural-Forms: \n" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#: model:ir.model,name:account_banking_pain_base.model_res_partner_bank +msgid "Bank Accounts" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:85 #, python-format msgid "Cannot compute the '%s'." msgstr "" @@ -38,19 +43,19 @@ msgid "Convert to ASCII" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:73 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:124 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:303 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:385 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:52 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:78 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:94 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:129 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:313 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:395 #, python-format msgid "Error:" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:83 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:88 #, python-format msgid "Field type error:" msgstr "" @@ -70,13 +75,18 @@ msgstr "" msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." msgstr "" +#. module: account_banking_pain_base +#: field:res.company,initiating_party_identifier:0 +msgid "Initiating Party Identifier" +msgstr "" + #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 msgid "Initiating Party Issuer" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:396 #, python-format msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." msgstr "" @@ -112,31 +122,31 @@ msgid "Structured Communication Type" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:95 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:314 #, python-format msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:130 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:52 #, python-format msgid "This IBAN is not valid : %s" msgstr "" @@ -146,6 +156,11 @@ msgstr "" msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." msgstr "" +#. module: account_banking_pain_base +#: help:res.company,initiating_party_identifier:0 +msgid "This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo." +msgstr "" + #. module: account_banking_pain_base #: help:res.company,initiating_party_issuer:0 msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." diff --git a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py new file mode 100644 index 000000000..eae959b03 --- /dev/null +++ b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre +# +# 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.addons.account_banking_pain_base.post_install\ + import set_default_initiating_party + + +def migrate(cr, version): + if not version: + return + + set_default_initiating_party(cr, None) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 8c0ed3fff..d858d52fb 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -256,13 +256,18 @@ class BankingExportPain(orm.AbstractModel): initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name - initiating_party_identifier = self.pool['res.company'].\ - _get_initiating_party_identifier( - cr, uid, - gen_args['sepa_export'].payment_order_ids[0].company_id.id, - context=context) - initiating_party_issuer = gen_args['sepa_export'].\ - payment_order_ids[0].company_id.initiating_party_issuer + initiating_party_identifier = self._prepare_field( + cr, uid, 'Initiating Party Identifier', + 'sepa_export.payment_order_ids[0].company_id.' + 'initiating_party_identifier', + {'sepa_export': gen_args['sepa_export']}, + 35, gen_args=gen_args, context=context) + initiating_party_issuer = self._prepare_field( + cr, uid, 'Initiating Party Issuer', + 'sepa_export.payment_order_ids[0].company_id.' + 'initiating_party_issuer', + {'sepa_export': gen_args['sepa_export']}, + 35, gen_args=gen_args, context=context) if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 2e5509de4..465984559 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -2,7 +2,7 @@ ############################################################################## # # PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # Copyright (C) 2013 Noviat (http://www.noviat.com) # @author: Alexis de Lattre # @author: Luc de Meyer (Noviat) @@ -22,59 +22,17 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class ResCompany(orm.Model): +class ResCompany(models.Model): _inherit = 'res.company' - _columns = { - 'initiating_party_issuer': fields.char( - 'Initiating Party Issuer', size=35, - help="This will be used as the 'Initiating Party Issuer' in the " - "PAIN files generated by Odoo."), - } - - def _get_initiating_party_identifier( - self, cr, uid, company_id, context=None): - """The code here may be different from one country to another. - If you need to add support for an additionnal country, you can - contribute your code here or inherit this function in the - localization modules for your country""" - assert isinstance(company_id, int), 'Only one company ID' - company = self.browse(cr, uid, company_id, context=context) - company_vat = company.vat - party_identifier = company.sepa_creditor_identifier - if not party_identifier and company_vat: - country_code = company_vat[0:2].upper() - if country_code == 'BE': - party_identifier = company_vat[2:].replace(' ', '') - return party_identifier - - def _initiating_party_issuer_default(self, cr, uid, context=None): - """If you need to add support for an additionnal country, you can - add an entry in the dict "party_issuer_per_country" here - or inherit this function in the localization modules for - your country""" - initiating_party_issuer = '' - # If your country require the 'Initiating Party Issuer', you should - # contribute the entry for your country in the dict below - party_issuer_per_country = { - 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium - } - company_id = self._company_default_get( - cr, uid, 'res.company', context=context) - if company_id: - company = self.browse(cr, uid, company_id, context=context) - country_code = company.country_id.code - initiating_party_issuer = party_issuer_per_country.get( - country_code, '') - return initiating_party_issuer - - def _initiating_party_issuer_def(self, cr, uid, context=None): - return self._initiating_party_issuer_default( - cr, uid, context=context) - - _defaults = { - 'initiating_party_issuer': _initiating_party_issuer_def, - } + initiating_party_issuer = fields.Char( + string='Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by Odoo.") + initiating_party_identifier = fields.Char( + string='Initiating Party Identifier', size=35, + help="This will be used as the 'Initiating Party Identifier' in " + "the PAIN files generated by Odoo.") diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py new file mode 100644 index 000000000..2ae817710 --- /dev/null +++ b/account_banking_pain_base/post_install.py @@ -0,0 +1,57 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + + +def set_default_initiating_party(cr, registry): + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + cr.execute(''' + SELECT + res_company.id, + res_country.code AS country_code, + res_partner.vat, + res_company.initiating_party_identifier, + res_company.initiating_party_issuer + FROM res_company + LEFT JOIN res_partner ON res_partner.id = res_company.partner_id + LEFT JOIN res_country ON res_country.id = res_partner.country_id + ''') + for company in cr.dictfetchall(): + country_code = company['country_code'] + if not company['initiating_party_issuer']: + if country_code and country_code in party_issuer_per_country: + cr.execute( + 'UPDATE res_company SET initiating_party_issuer=%s ' + 'WHERE id=%s', + (party_issuer_per_country[country_code], company['id'])) + party_identifier = False + if not company['initiating_party_identifier']: + if company['vat'] and country_code: + if country_code == 'BE': + party_identifier = company['vat'][2:].replace(' ', '') + if party_identifier: + cr.execute( + 'UPDATE res_company SET initiating_party_identifier=%s ' + 'WHERE id=%s', + (party_identifier, company['id'])) + return diff --git a/account_banking_pain_base/views/res_company_view.xml b/account_banking_pain_base/views/res_company_view.xml index a98d9b641..fd3af4755 100644 --- a/account_banking_pain_base/views/res_company_view.xml +++ b/account_banking_pain_base/views/res_company_view.xml @@ -1,6 +1,6 @@ @@ -14,6 +14,7 @@ + From 84ed8f8c1edb5f9518379637eedd61f7551f30ae Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 1 Jun 2015 19:28:47 +0200 Subject: [PATCH 37/79] Better import --- account_banking_pain_base/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index 49f1f9fc1..06e1d7cff 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -21,4 +21,4 @@ ############################################################################## from . import models -from post_install import set_default_initiating_party +from .post_install import set_default_initiating_party From 4eb8ada3530179c8f943a3e7a6a902a6aff57a22 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Jun 2015 11:13:26 +0200 Subject: [PATCH 38/79] Replace SQL by code that uses the ORM, as suggested by Pedro Move part of the migration code to res_company.py, so that it's possible to inherit in other modules --- .../migrations/8.0.0.2/post-migration.py | 4 +- .../models/res_company.py | 35 +++++++++++++++- account_banking_pain_base/post_install.py | 41 ++++--------------- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py index eae959b03..bb6322681 100644 --- a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py +++ b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py @@ -21,10 +21,12 @@ from openerp.addons.account_banking_pain_base.post_install\ import set_default_initiating_party +from openerp import pooler def migrate(cr, version): if not version: return - set_default_initiating_party(cr, None) + pool = pooler.get_pool(cr.dbname) + set_default_initiating_party(cr, pool) diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 465984559..bb656b55a 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -22,7 +22,10 @@ # ############################################################################## -from openerp import models, fields +from openerp import models, fields, api +import logging + +logger = logging.getLogger(__name__) class ResCompany(models.Model): @@ -36,3 +39,33 @@ class ResCompany(models.Model): string='Initiating Party Identifier', size=35, help="This will be used as the 'Initiating Party Identifier' in " "the PAIN files generated by Odoo.") + + @api.model + def _default_initiating_party(self, company): + '''This method is called from post_install.py, which itself is also + called from migrations/8.0.0.2/post-migration.py''' + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + logger.debug( + 'Calling _default_initiating_party on company %s', company.name) + country_code = company.country_id.code + if not company.initiating_party_issuer: + if country_code and country_code in party_issuer_per_country: + company.write({ + 'initiating_party_issuer': + party_issuer_per_country[country_code]}) + logger.info( + 'Updated initiating_party_issuer on company %s', + company.name) + party_identifier = False + if not company.initiating_party_identifier: + if company.vat and country_code: + if country_code == 'BE': + party_identifier = company.vat[2:].replace(' ', '') + if party_identifier: + company.write({ + 'initiating_party_identifier': party_identifier}) + logger.info( + 'Updated initiating_party_identifier on company %s', + company.name) diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index 2ae817710..d48fd2f63 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -20,38 +20,13 @@ # ############################################################################## +from openerp import SUPERUSER_ID -def set_default_initiating_party(cr, registry): - party_issuer_per_country = { - 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium - } - cr.execute(''' - SELECT - res_company.id, - res_country.code AS country_code, - res_partner.vat, - res_company.initiating_party_identifier, - res_company.initiating_party_issuer - FROM res_company - LEFT JOIN res_partner ON res_partner.id = res_company.partner_id - LEFT JOIN res_country ON res_country.id = res_partner.country_id - ''') - for company in cr.dictfetchall(): - country_code = company['country_code'] - if not company['initiating_party_issuer']: - if country_code and country_code in party_issuer_per_country: - cr.execute( - 'UPDATE res_company SET initiating_party_issuer=%s ' - 'WHERE id=%s', - (party_issuer_per_country[country_code], company['id'])) - party_identifier = False - if not company['initiating_party_identifier']: - if company['vat'] and country_code: - if country_code == 'BE': - party_identifier = company['vat'][2:].replace(' ', '') - if party_identifier: - cr.execute( - 'UPDATE res_company SET initiating_party_identifier=%s ' - 'WHERE id=%s', - (party_identifier, company['id'])) + +def set_default_initiating_party(cr, pool): + company_ids = pool['res.company'].search(cr, SUPERUSER_ID, []) + companies = pool['res.company'].browse(cr, SUPERUSER_ID, company_ids) + for company in companies: + pool['res.company']._default_initiating_party( + cr, SUPERUSER_ID, company) return From 14de04c01c240c7eb2fb0c4eb4b7dc440d082500 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Jun 2015 12:24:49 +0200 Subject: [PATCH 39/79] Add hook to block in localization modules that want raise if initiating_party is not set --- .../models/banking_export_pain.py | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index d858d52fb..e47d21ff6 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -246,6 +246,11 @@ class BankingExportPain(orm.AbstractModel): requested_date_2_17.text = requested_date return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + def _must_have_initiating_party(self, cr, uid, gen_args, context=None): + '''This method is designed to be inherited in localization modules for + countries in which the initiating party is required''' + return False + def generate_initiating_party_block( self, cr, uid, parent_node, gen_args, context=None): my_company_name = self._prepare_field( @@ -256,18 +261,12 @@ class BankingExportPain(orm.AbstractModel): initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name - initiating_party_identifier = self._prepare_field( - cr, uid, 'Initiating Party Identifier', - 'sepa_export.payment_order_ids[0].company_id.' - 'initiating_party_identifier', - {'sepa_export': gen_args['sepa_export']}, - 35, gen_args=gen_args, context=context) - initiating_party_issuer = self._prepare_field( - cr, uid, 'Initiating Party Issuer', - 'sepa_export.payment_order_ids[0].company_id.' - 'initiating_party_issuer', - {'sepa_export': gen_args['sepa_export']}, - 35, gen_args=gen_args, context=context) + initiating_party_identifier =\ + gen_args['sepa_export'].payment_order_ids[0].company_id.\ + initiating_party_identifier + initiating_party_issuer =\ + gen_args['sepa_export'].payment_order_ids[0].company_id.\ + initiating_party_issuer if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') @@ -277,6 +276,14 @@ class BankingExportPain(orm.AbstractModel): iniparty_org_other_issuer = etree.SubElement( iniparty_org_other, 'Issr') iniparty_org_other_issuer.text = initiating_party_issuer + elif self._must_have_initiating_party(cr, uid, gen_args, + context=context): + raise orm.except_orm( + _('Error:'), + _("Missing 'Initiating Party Issuer' and/or " + "'Initiating Party Identifier' for the company '%s'. " + "Both fields must have a value.") + % gen_args['sepa_export'].payment_order_ids[0].company_id.name) return True def generate_party_agent( From 8140ac4700e1c7084a6b99387aa045658acdd268 Mon Sep 17 00:00:00 2001 From: Philippe Schmidt Date: Mon, 1 Jun 2015 17:10:58 +0200 Subject: [PATCH 40/79] Add requested descriptions in an OCA README.rst file --- account_banking_pain_base/README.rst | 77 ++++++++++++++++++++++++ account_banking_pain_base/__openerp__.py | 12 ---- 2 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 account_banking_pain_base/README.rst diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst new file mode 100644 index 000000000..3cc7a8591 --- /dev/null +++ b/account_banking_pain_base/README.rst @@ -0,0 +1,77 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Account Banking PAIN Base Module +================================ + +This module contains fields and functions that are used by the module for SEPA +Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit +(account_banking_sepa_direct_debit). This module doesn't provide any +functionality by itself. + +This module was started during the Akretion-Noviat code sprint of November +21st 2013 in Epiais les Louvres (France). + +Installation +============ + +This module depends on : +- account_banking_payment_export + +This modules are parts of the OCA/bank-payment suite. + +Configuration +============= + +No configuration required. + +Usage +===== + +See 'readme' files of the OCA/bank-payment suite. + + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + +Known issues / Roadmap +====================== + + * ... + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + +Credits +======= + +Contributors +------------ + +* Alexis de Lattre +* Pedro M. Baeza +* Stéphane Bidoul +* Ignacio Ibeas - Acysos S.L. +* Alexandre Fayolle +* Raphaël Valyi +* Sandy Carter +* Stefan Rijnhart (Therp) + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 19aef3e38..3a5270ddf 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -41,17 +41,5 @@ 'views/res_company_view.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'description': ''' -Base module for PAIN file generation -==================================== - -This module contains fields and functions that are used by the module for SEPA -Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit -(account_banking_sepa_direct_debit). This module doesn't provide any -functionality by itself. - -This module was started during the Akretion-Noviat code sprint of November -21st 2013 in Epiais les Louvres (France). - ''', 'installable': True, } From 263a317be0942e967ece08e25edea67faba102c8 Mon Sep 17 00:00:00 2001 From: Philippe Schmidt Date: Fri, 5 Jun 2015 12:31:00 +0200 Subject: [PATCH 41/79] some typo corrections --- account_banking_pain_base/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index 3cc7a8591..fb9b48a2d 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -18,7 +18,7 @@ Installation This module depends on : - account_banking_payment_export -This modules are parts of the OCA/bank-payment suite. +This module is part of the OCA/bank-payment suite. Configuration ============= @@ -38,7 +38,7 @@ For further information, please visit: Known issues / Roadmap ====================== - * ... + * no known issues Bug Tracker =========== From edf7ab7c73b1418af48a82161b613992662aef04 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 6 Jun 2015 00:20:41 +0200 Subject: [PATCH 42/79] Port SEPA modules to new API Fix an important regression in account_banking_sepa_direct_debit: "Date of Last Debit" was not set any more Proper write of date_done with account_banking_payment_export is installed without account_banking_payment_transfer Add post-install script for date_sent on payment.order --- account_banking_pain_base/__init__.py | 2 +- account_banking_pain_base/__openerp__.py | 4 +- account_banking_pain_base/models/__init__.py | 2 +- .../models/banking_export_pain.py | 180 ++++++++---------- .../models/payment_line.py | 42 ++-- .../models/payment_mode.py | 24 +-- .../models/res_company.py | 2 +- 7 files changed, 105 insertions(+), 151 deletions(-) diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index 06e1d7cff..c4f18b657 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP +# PAIN Base module for Odoo # Copyright (C) 2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 3a5270ddf..089b3665e 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# PAIN base module for Odoo +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # # This program is free software: you can redistribute it and/or modify diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 22b8d64ae..8a4154482 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP +# PAIN Base module for Odoo # Copyright (C) 2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index e47d21ff6..82f40e160 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# PAIN Base module for Odoo +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,8 +20,8 @@ # ############################################################################## -from openerp.osv import orm -from openerp.tools.translate import _ +from openerp import models, api, _ +from openerp.exceptions import Warning from openerp.tools.safe_eval import safe_eval from datetime import datetime from lxml import etree @@ -38,21 +38,19 @@ except ImportError: logger = logging.getLogger(__name__) -class BankingExportPain(orm.AbstractModel): +class BankingExportPain(models.AbstractModel): _name = 'banking.export.pain' - def _validate_iban(self, cr, uid, iban, context=None): + def _validate_iban(self, iban): """if IBAN is valid, returns IBAN if IBAN is NOT valid, raises an error message""" - partner_bank_obj = self.pool.get('res.partner.bank') - if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): + if self.env['res.partner.bank'].is_iban_valid(iban): return iban.replace(' ', '') else: - raise orm.except_orm( - _('Error:'), _("This IBAN is not valid : %s") % iban) + raise Warning(_("This IBAN is not valid : %s") % iban) - def _prepare_field(self, cr, uid, field_name, field_value, eval_ctx, - max_size=0, gen_args=None, context=None): + def _prepare_field(self, field_name, field_value, eval_ctx, + max_size=0, gen_args=None): """This function is designed to be inherited !""" if gen_args is None: gen_args = {} @@ -74,31 +72,27 @@ class BankingExportPain(orm.AbstractModel): except: line = eval_ctx.get('line') if line: - raise orm.except_orm( - _('Error:'), + raise Warning( _("Cannot compute the '%s' of the Payment Line with " "reference '%s'.") % (field_name, line.name)) else: - raise orm.except_orm( - _('Error:'), + raise Warning( _("Cannot compute the '%s'.") % field_name) if not isinstance(value, (str, unicode)): - raise orm.except_orm( - _('Field type error:'), + raise Warning( _("The type of the field '%s' is %s. It should be a string " "or unicode.") % (field_name, type(value))) if not value: - raise orm.except_orm( - _('Error:'), + raise Warning( _("The '%s' is empty or 0. It should have a non-null value.") % field_name) if max_size and len(value) > max_size: value = value[0:max_size] return value - def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): + def _validate_xml(self, xml_string, gen_args): xsd_etree_obj = etree.parse( tools.file_open(gen_args['pain_xsd_file'])) official_pain_schema = etree.XMLSchema(xsd_etree_obj) @@ -111,19 +105,18 @@ class BankingExportPain(orm.AbstractModel): "The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) logger.warning(e) - raise orm.except_orm( - _('Error:'), + raise Warning( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. Here " "is the error, which may give you an idea on the cause " "of the problem : %s") - % str(e)) + % unicode(e)) return True + @api.multi def finalize_sepa_file_creation( - self, cr, uid, ids, xml_root, total_amount, transactions_count, - gen_args, context=None): + self, xml_root, total_amount, transactions_count, gen_args): xml_string = etree.tostring( xml_root, pretty_print=True, encoding='UTF-8', xml_declaration=True) @@ -131,44 +124,41 @@ class BankingExportPain(orm.AbstractModel): "Generated SEPA XML file in format %s below" % gen_args['pain_flavor']) logger.debug(xml_string) - self._validate_xml(cr, uid, xml_string, gen_args, context=context) + self._validate_xml(xml_string, gen_args) order_ref = [] - for order in gen_args['sepa_export'].payment_order_ids: + for order in self.payment_order_ids: if order.reference: order_ref.append(order.reference.replace('/', '-')) filename = '%s%s.xml' % (gen_args['file_prefix'], '-'.join(order_ref)) - self.write( - cr, uid, ids, { - 'nb_transactions': transactions_count, - 'total_amount': total_amount, - 'filename': filename, - 'file': base64.encodestring(xml_string), - 'state': 'finish', - }, context=context) + self.write({ + 'nb_transactions': transactions_count, + 'total_amount': total_amount, + 'filename': filename, + 'file': base64.encodestring(xml_string), + 'state': 'finish', + }) action = { - 'name': 'SEPA File', + 'name': _('SEPA File'), 'type': 'ir.actions.act_window', 'view_type': 'form', 'view_mode': 'form,tree', 'res_model': self._name, - 'res_id': ids[0], + 'res_id': self.ids[0], 'target': 'new', } return action - def generate_group_header_block( - self, cr, uid, parent_node, gen_args, context=None): + def generate_group_header_block(self, parent_node, gen_args): group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') message_identification_1_1 = etree.SubElement( group_header_1_0, 'MsgId') message_identification_1_1.text = self._prepare_field( - cr, uid, 'Message Identification', - 'sepa_export.payment_order_ids[0].reference', - {'sepa_export': gen_args['sepa_export']}, 35, - gen_args=gen_args, context=context) + 'Message Identification', + 'self.payment_order_ids[0].reference', + {'self': self}, 35, gen_args=gen_args) creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') creation_date_time_1_2.text = datetime.strftime( datetime.today(), '%Y-%m-%dT%H:%M:%S') @@ -176,8 +166,7 @@ class BankingExportPain(orm.AbstractModel): # batch_booking is in "Group header" with pain.001.001.02 # and in "Payment info" in pain.001.001.03/04 batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') - batch_booking.text = \ - str(gen_args['sepa_export'].batch_booking).lower() + batch_booking.text = unicode(self.batch_booking).lower() nb_of_transactions_1_6 = etree.SubElement( group_header_1_0, 'NbOfTxs') control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') @@ -185,30 +174,26 @@ class BankingExportPain(orm.AbstractModel): if gen_args.get('pain_flavor') == 'pain.001.001.02': grouping = etree.SubElement(group_header_1_0, 'Grpg') grouping.text = 'GRPD' - self.generate_initiating_party_block( - cr, uid, group_header_1_0, gen_args, - context=context) + self.generate_initiating_party_block(group_header_1_0, gen_args) return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 def generate_start_payment_info_block( - self, cr, uid, parent_node, payment_info_ident, + self, parent_node, payment_info_ident, priority, local_instrument, sequence_type, requested_date, - eval_ctx, gen_args, context=None): + eval_ctx, gen_args): payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') payment_info_identification_2_1 = etree.SubElement( payment_info_2_0, 'PmtInfId') payment_info_identification_2_1.text = self._prepare_field( - cr, uid, 'Payment Information Identification', - payment_info_ident, eval_ctx, 35, - gen_args=gen_args, context=context) + 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, gen_args=gen_args) payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') payment_method_2_2.text = gen_args['payment_method'] nb_of_transactions_2_4 = False control_sum_2_5 = False if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = \ - str(gen_args['sepa_export'].batch_booking).lower() + batch_booking_2_3.text = unicode(self.batch_booking).lower() # The "SEPA Customer-to-bank # Implementation guidelines" for SCT and SDD says that control sum # and nb_of_transactions should be present @@ -246,26 +231,24 @@ class BankingExportPain(orm.AbstractModel): requested_date_2_17.text = requested_date return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 - def _must_have_initiating_party(self, cr, uid, gen_args, context=None): + def _must_have_initiating_party(self, gen_args): '''This method is designed to be inherited in localization modules for countries in which the initiating party is required''' return False - def generate_initiating_party_block( - self, cr, uid, parent_node, gen_args, context=None): + def generate_initiating_party_block(self, parent_node, gen_args): my_company_name = self._prepare_field( - cr, uid, 'Company Name', - 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', - {'sepa_export': gen_args['sepa_export']}, - gen_args.get('name_maxsize'), gen_args=gen_args, context=context) + 'Company Name', + 'self.payment_order_ids[0].mode.bank_id.partner_id.name', + {'self': self}, gen_args.get('name_maxsize'), gen_args=gen_args) initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name initiating_party_identifier =\ - gen_args['sepa_export'].payment_order_ids[0].company_id.\ + self.payment_order_ids[0].company_id.\ initiating_party_identifier initiating_party_issuer =\ - gen_args['sepa_export'].payment_order_ids[0].company_id.\ + self.payment_order_ids[0].company_id.\ initiating_party_issuer if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') @@ -276,36 +259,33 @@ class BankingExportPain(orm.AbstractModel): iniparty_org_other_issuer = etree.SubElement( iniparty_org_other, 'Issr') iniparty_org_other_issuer.text = initiating_party_issuer - elif self._must_have_initiating_party(cr, uid, gen_args, - context=context): - raise orm.except_orm( - _('Error:'), + elif self._must_have_initiating_party(gen_args): + raise Warning( _("Missing 'Initiating Party Issuer' and/or " "'Initiating Party Identifier' for the company '%s'. " "Both fields must have a value.") - % gen_args['sepa_export'].payment_order_ids[0].company_id.name) + % self.payment_order_ids[0].company_id.name) return True def generate_party_agent( - self, cr, uid, parent_node, party_type, party_type_label, - order, party_name, iban, bic, eval_ctx, gen_args, context=None): + self, parent_node, party_type, party_type_label, + order, party_name, iban, bic, eval_ctx, gen_args): """Generate the piece of the XML file corresponding to BIC This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" try: bic = self._prepare_field( - cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, - gen_args=gen_args, context=context) + '%s BIC' % party_type_label, bic, eval_ctx, gen_args=gen_args) party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) party_agent_institution = etree.SubElement( party_agent, 'FinInstnId') party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = bic - except orm.except_orm: + except Warning: if order == 'C': if iban[0:2] != gen_args['initiating_party_country_code']: - raise orm.except_orm( + raise Warning( _('Error:'), _("The bank account with IBAN '%s' of partner '%s' " "must have an associated BIC because it is a " @@ -328,8 +308,8 @@ class BankingExportPain(orm.AbstractModel): return True def generate_party_block( - self, cr, uid, parent_node, party_type, order, name, iban, bic, - eval_ctx, gen_args, context=None): + self, parent_node, party_type, order, name, iban, bic, + eval_ctx, gen_args): """Generate the piece of the XML file corresponding to Name+IBAN+BIC This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" @@ -338,23 +318,19 @@ class BankingExportPain(orm.AbstractModel): elif party_type == 'Dbtr': party_type_label = 'Debtor' party_name = self._prepare_field( - cr, uid, '%s Name' % party_type_label, name, eval_ctx, - gen_args.get('name_maxsize'), - gen_args=gen_args, context=context) + '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), gen_args=gen_args) piban = self._prepare_field( - cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, - gen_args=gen_args, - context=context) - viban = self._validate_iban(cr, uid, piban, context=context) + '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args) + viban = self._validate_iban(piban) # At C level, the order is : BIC, Name, IBAN # At B level, the order is : Name, IBAN, BIC if order == 'B': gen_args['initiating_party_country_code'] = viban[0:2] elif order == 'C': self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) + parent_node, party_type, party_type_label, + order, party_name, viban, bic, eval_ctx, gen_args) party = etree.SubElement(parent_node, party_type) party_nm = etree.SubElement(party, 'Nm') party_nm.text = party_name @@ -366,13 +342,11 @@ class BankingExportPain(orm.AbstractModel): party_account_iban.text = viban if order == 'B': self.generate_party_agent( - cr, uid, parent_node, party_type, party_type_label, - order, party_name, viban, bic, - eval_ctx, gen_args, context=context) + parent_node, party_type, party_type_label, + order, party_name, viban, bic, eval_ctx, gen_args) return True - def generate_remittance_info_block( - self, cr, uid, parent_node, line, gen_args, context=None): + def generate_remittance_info_block(self, parent_node, line, gen_args): remittance_info_2_91 = etree.SubElement( parent_node, 'RmtInf') @@ -381,14 +355,12 @@ class BankingExportPain(orm.AbstractModel): remittance_info_2_91, 'Ustrd') remittance_info_unstructured_2_99.text = \ self._prepare_field( - cr, uid, 'Remittance Unstructured Information', + 'Remittance Unstructured Information', 'line.communication', {'line': line}, 140, - gen_args=gen_args, - context=context) + gen_args=gen_args) else: if not line.struct_communication_type: - raise orm.except_orm( - _('Error:'), + raise Warning( _("Missing 'Structured Communication Type' on payment " "line with reference '%s'.") % line.name) @@ -422,22 +394,20 @@ class BankingExportPain(orm.AbstractModel): line.struct_communication_type creditor_reference_2_126.text = \ self._prepare_field( - cr, uid, 'Creditor Structured Reference', + 'Creditor Structured Reference', 'line.communication', {'line': line}, 35, - gen_args=gen_args, - context=context) + gen_args=gen_args) return True def generate_creditor_scheme_identification( - self, cr, uid, parent_node, identification, identification_label, - eval_ctx, scheme_name_proprietary, gen_args, context=None): + self, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args): csi_id = etree.SubElement(parent_node, 'Id') csi_privateid = etree.SubElement(csi_id, 'PrvtId') csi_other = etree.SubElement(csi_privateid, 'Othr') csi_other_id = etree.SubElement(csi_other, 'Id') csi_other_id.text = self._prepare_field( - cr, uid, identification_label, identification, eval_ctx, - gen_args=gen_args, context=context) + identification_label, identification, eval_ctx, gen_args=gen_args) csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') csi_scheme_name_proprietary = etree.SubElement( csi_scheme_name, 'Prtry') diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 872827b7b..9717fd562 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# PAIN Base module for Odoo +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,33 +20,23 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class PaymentLine(orm.Model): +class PaymentLine(models.Model): _inherit = 'payment.line' - def _get_struct_communication_types(self, cr, uid, context=None): + def _get_struct_communication_types(self): return [('ISO', 'ISO')] - _columns = { - 'priority': fields.selection( - [('NORM', 'Normal'), - ('HIGH', 'High')], 'Priority', - help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file."), - # Update size from 64 to 140, because PAIN allows 140 caracters - 'communication': fields.char( - 'Communication', size=140, required=True, - help="Used as the message between ordering customer and current " - "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'), - } - - _defaults = { - 'priority': 'NORM', - 'struct_communication_type': 'ISO', - } + priority = fields.Selection([ + ('NORM', 'Normal'), + ('HIGH', 'High')], + string='Priority', default='NORM', + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file.") + # Update size from 64 to 140, because PAIN allows 140 caracters + communication = fields.Char(size=140) + struct_communication_type = fields.Selection( + '_get_struct_communication_types', + string='Structured Communication Type', default='ISO') diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/payment_mode.py index ff9254ca0..9ca025e27 100644 --- a/account_banking_pain_base/models/payment_mode.py +++ b/account_banking_pain_base/models/payment_mode.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# PAIN Base module for Odoo +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # @author: Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,20 +20,14 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class payment_mode(orm.Model): +class PaymentMode(models.Model): _inherit = 'payment.mode' - _columns = { - 'convert_to_ascii': fields.boolean( - 'Convert to ASCII', - help="If active, Odoo will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file."), - } - - _defaults = { - 'convert_to_ascii': True, - } + convert_to_ascii = fields.Boolean( + string='Convert to ASCII', default=True, + help="If active, Odoo will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file.") diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index bb656b55a..0a62caab9 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# PAIN Base module for OpenERP +# PAIN Base module for Odoo # Copyright (C) 2013-2015 Akretion (http://www.akretion.com) # Copyright (C) 2013 Noviat (http://www.noviat.com) # @author: Alexis de Lattre From 883ecc60a4866bbc814dc2f47b942243b2d80ef1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 8 Jun 2015 14:11:38 +0200 Subject: [PATCH 43/79] account_banking_pain_base: add @api.model on all methods of banking_export_pain.py --- .../models/banking_export_pain.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 82f40e160..0ff137773 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -41,6 +41,7 @@ logger = logging.getLogger(__name__) class BankingExportPain(models.AbstractModel): _name = 'banking.export.pain' + @api.model def _validate_iban(self, iban): """if IBAN is valid, returns IBAN if IBAN is NOT valid, raises an error message""" @@ -49,6 +50,7 @@ class BankingExportPain(models.AbstractModel): else: raise Warning(_("This IBAN is not valid : %s") % iban) + @api.model def _prepare_field(self, field_name, field_value, eval_ctx, max_size=0, gen_args=None): """This function is designed to be inherited !""" @@ -92,6 +94,7 @@ class BankingExportPain(models.AbstractModel): value = value[0:max_size] return value + @api.model def _validate_xml(self, xml_string, gen_args): xsd_etree_obj = etree.parse( tools.file_open(gen_args['pain_xsd_file'])) @@ -151,6 +154,7 @@ class BankingExportPain(models.AbstractModel): } return action + @api.model def generate_group_header_block(self, parent_node, gen_args): group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') message_identification_1_1 = etree.SubElement( @@ -177,6 +181,7 @@ class BankingExportPain(models.AbstractModel): self.generate_initiating_party_block(group_header_1_0, gen_args) return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + @api.model def generate_start_payment_info_block( self, parent_node, payment_info_ident, priority, local_instrument, sequence_type, requested_date, @@ -231,11 +236,13 @@ class BankingExportPain(models.AbstractModel): requested_date_2_17.text = requested_date return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + @api.model def _must_have_initiating_party(self, gen_args): '''This method is designed to be inherited in localization modules for countries in which the initiating party is required''' return False + @api.model def generate_initiating_party_block(self, parent_node, gen_args): my_company_name = self._prepare_field( 'Company Name', @@ -267,6 +274,7 @@ class BankingExportPain(models.AbstractModel): % self.payment_order_ids[0].company_id.name) return True + @api.model def generate_party_agent( self, parent_node, party_type, party_type_label, order, party_name, iban, bic, eval_ctx, gen_args): @@ -307,6 +315,7 @@ class BankingExportPain(models.AbstractModel): # as per the guidelines of the EPC return True + @api.model def generate_party_block( self, parent_node, party_type, order, name, iban, bic, eval_ctx, gen_args): @@ -346,8 +355,8 @@ class BankingExportPain(models.AbstractModel): order, party_name, viban, bic, eval_ctx, gen_args) return True + @api.model def generate_remittance_info_block(self, parent_node, line, gen_args): - remittance_info_2_91 = etree.SubElement( parent_node, 'RmtInf') if line.state == 'normal': @@ -399,6 +408,7 @@ class BankingExportPain(models.AbstractModel): gen_args=gen_args) return True + @api.model def generate_creditor_scheme_identification( self, parent_node, identification, identification_label, eval_ctx, scheme_name_proprietary, gen_args): From 24861b05d6555ff6a2b2264ccece57e2dc372daf Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 13 Jun 2015 13:57:01 +0200 Subject: [PATCH 44/79] Add @api.model on _get_struct_communication_types --- account_banking_pain_base/models/payment_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 9717fd562..8f0160be2 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -20,12 +20,13 @@ # ############################################################################## -from openerp import models, fields +from openerp import models, fields, api class PaymentLine(models.Model): _inherit = 'payment.line' + @api.model def _get_struct_communication_types(self): return [('ISO', 'ISO')] From 4856ad29edc43a1f889c8646e18af540b3a8dd36 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 18 Aug 2015 11:10:50 +0200 Subject: [PATCH 45/79] Add missing default oca icons --- .../static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 account_banking_pain_base/static/description/icon.png diff --git a/account_banking_pain_base/static/description/icon.png b/account_banking_pain_base/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 0f7a8f8f81508bf7b7dab83ef0a2ca12b4633770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 09:59:34 +0200 Subject: [PATCH 46/79] [UPD] prefix versions with 8.0 --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 089b3665e..191ffb3cd 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '0.2', + 'version': '8.0.0.2.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " From d0b41b7f441b1359a66f5a926be0057943597218 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 03:03:12 +0200 Subject: [PATCH 47/79] [MIG] Make modules uninstallable --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 191ffb3cd..8250fa55b 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -41,5 +41,5 @@ 'views/res_company_view.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'installable': True, + 'installable': False, } From 0590547adca5ff18f00119a6621d7bc65001a60a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 21 Sep 2015 12:32:45 +0200 Subject: [PATCH 48/79] Add bank.payment.lines object to allow grouping in the payments --- account_banking_pain_base/__openerp__.py | 1 + account_banking_pain_base/models/__init__.py | 1 + .../models/bank_payment_line.py | 40 +++++++++++++++++++ .../views/bank_payment_line_view.xml | 25 ++++++++++++ .../views/payment_line_view.xml | 17 +------- 5 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 account_banking_pain_base/models/bank_payment_line.py create mode 100644 account_banking_pain_base/views/bank_payment_line_view.xml diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 8250fa55b..761be64a1 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -37,6 +37,7 @@ }, 'data': [ 'views/payment_line_view.xml', + 'views/bank_payment_line_view.xml', 'views/payment_mode_view.xml', 'views/res_company_view.xml', ], diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 8a4154482..829202c43 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -21,6 +21,7 @@ ############################################################################## from . import payment_line +from . import bank_payment_line from . import payment_mode from . import res_company from . import banking_export_pain diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py new file mode 100644 index 000000000..c00d9d9d0 --- /dev/null +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -0,0 +1,40 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for Odoo +# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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, api + + +class BankPaymentLine(models.Model): + _inherit = 'bank.payment.line' + + priority = fields.Selection( + related='payment_line_ids.priority', string='Priority') + struct_communication_type = fields.Selection( + related='payment_line_ids.struct_communication_type', + string='Structured Communication Type') + + @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', 'struct_communication_type'] + return res diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml new file mode 100644 index 000000000..65e993ad6 --- /dev/null +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -0,0 +1,25 @@ + + + + + + + pain.base.bank.payment.line.form + bank.payment.line + + + + + + + + + + + + + diff --git a/account_banking_pain_base/views/payment_line_view.xml b/account_banking_pain_base/views/payment_line_view.xml index f92b1bbf5..03759b568 100644 --- a/account_banking_pain_base/views/payment_line_view.xml +++ b/account_banking_pain_base/views/payment_line_view.xml @@ -7,25 +7,10 @@ - - pain.base.payment.line.form - payment.line - - - - - - - - - - - - pain.base.payment.line.inside.order.form payment.order - + From 264be465d1c0c76667f55f551996e78d0ed20354 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 15 Feb 2016 23:10:18 +0100 Subject: [PATCH 49/79] [IMP] *: Short headers --- account_banking_pain_base/__init__.py | 25 +++-------------- account_banking_pain_base/__openerp__.py | 26 ++++------------- .../migrations/8.0.0.2/post-migration.py | 21 ++------------ account_banking_pain_base/models/__init__.py | 24 ++-------------- .../models/bank_payment_line.py | 24 ++-------------- .../models/banking_export_pain.py | 25 +++-------------- .../models/payment_line.py | 25 +++-------------- .../models/payment_mode.py | 25 +++-------------- .../models/res_company.py | 28 ++++--------------- .../models/res_partner_bank.py | 23 +++------------ account_banking_pain_base/post_install.py | 25 +++-------------- 11 files changed, 42 insertions(+), 229 deletions(-) diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index c4f18b657..44319ee0a 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models from .post_install import set_default_initiating_party diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 761be64a1..b6c2cca40 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -1,24 +1,8 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', diff --git a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py index bb6322681..1a2815795 100644 --- a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py +++ b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# © 2015 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.addons.account_banking_pain_base.post_install\ import set_default_initiating_party diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 829202c43..ffc2334f3 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,24 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import payment_line from . import bank_payment_line diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index c00d9d9d0..e67a46be6 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -1,24 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 0ff137773..6d2ea34ab 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api, _ from openerp.exceptions import Warning diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 8f0160be2..70f214721 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/payment_mode.py index 9ca025e27..1ccc72fe5 100644 --- a/account_banking_pain_base/models/payment_mode.py +++ b/account_banking_pain_base/models/payment_mode.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 0a62caab9..aed1c1ca1 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,26 +1,8 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2013-2015 Akretion (http://www.akretion.com) -# Copyright (C) 2013 Noviat (http://www.noviat.com) -# @author: Alexis de Lattre -# @author: Luc de Meyer (Noviat) -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013-2015 Akretion - Alexis de Lattre +# © 2013 Noviat (http://www.noviat.com) - Luc de Meyer +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api import logging diff --git a/account_banking_pain_base/models/res_partner_bank.py b/account_banking_pain_base/models/res_partner_bank.py index 3c7a5ff0d..76722a561 100644 --- a/account_banking_pain_base/models/res_partner_bank.py +++ b/account_banking_pain_base/models/res_partner_bank.py @@ -1,22 +1,7 @@ -# -*- 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2013 ACSONE SA/NV () +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index d48fd2f63..90e46fec2 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -1,24 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# PAIN Base module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from openerp import SUPERUSER_ID From ff2599a8528c62aaf45e99abd76a1196683cb482 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 15 Feb 2016 23:17:37 +0100 Subject: [PATCH 50/79] [IMP] *: Bump version numbers --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index b6c2cca40..6ee208c1c 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -6,7 +6,7 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '8.0.0.2.0', + 'version': '8.0.0.3.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " From 9f66889a9eb9d15b5f35cdfdb160c4e5a1bb72bf Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 16 Feb 2016 09:02:09 +0100 Subject: [PATCH 51/79] [IMP] *: es translations --- account_banking_pain_base/i18n/es.po | 66 ++++++++++++++++++---------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po index 61fa1e0ba..c97064abc 100644 --- a/account_banking_pain_base/i18n/es.po +++ b/account_banking_pain_base/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-31 22:52+0000\n" -"PO-Revision-Date: 2014-10-31 22:52+0000\n" +"POT-Creation-Date: 2016-02-16 07:24+0000\n" +"PO-Revision-Date: 2016-02-16 07:24+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,13 +16,23 @@ msgstr "" "Plural-Forms: \n" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#: model:ir.model,name:account_banking_pain_base.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Cuentas de banco" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Líneas de pago bancario" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:61 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:66 #, python-format msgid "Cannot compute the '%s'." msgstr "No se puede procesar el campo '%s'." @@ -38,23 +48,11 @@ msgid "Convert to ASCII" msgstr "Convertir a ASCII" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:73 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:124 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:303 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:385 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:280 #, python-format msgid "Error:" msgstr "Error:" -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:83 -#, python-format -msgid "Field type error:" -msgstr "" - #. module: account_banking_pain_base #: selection:payment.line,priority:0 msgid "High" @@ -70,13 +68,24 @@ msgstr "ID" msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado." +#. module: account_banking_pain_base +#: field:res.company,initiating_party_identifier:0 +msgid "Initiating Party Identifier" +msgstr "Identificador del iniciador de la transacción" + #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 msgid "Initiating Party Issuer" msgstr "Emisor de la transacción" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:254 +#, python-format +msgid "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for the company '%s'. Both fields must have a value." +msgstr "Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la transacción' para la compañía '%s'. Ambos campos deben tener un valor." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:356 #, python-format msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." msgstr "Falta el campo 'Tipo de comunicación estructurada' en la línea de pago con referencia '%s'." @@ -106,37 +115,43 @@ msgstr "Modo de pago" msgid "Priority" msgstr "Prioridad" +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:130 +#, python-format +msgid "SEPA File" +msgstr "Archivo SEPA" + #. module: account_banking_pain_base #: field:payment.line,struct_communication_type:0 msgid "Structured Communication Type" msgstr "Tipo de comunicación estructurada" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:281 #, python-format msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." msgstr "La cuenta bancaria con IBAN '%s' de la empresa '%s' debe tener un BIC asociado, porque es una operación SEPA transfronteriza." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:95 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:69 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:34 #, python-format msgid "This IBAN is not valid : %s" msgstr "Este IBAN no es válido: %s" @@ -146,6 +161,11 @@ msgstr "Este IBAN no es válido: %s" msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado." +#. module: account_banking_pain_base +#: help:res.company,initiating_party_identifier:0 +msgid "This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo." +msgstr "Esto se usará como el 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo." + #. module: account_banking_pain_base #: help:res.company,initiating_party_issuer:0 msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." From eec3b4c09289f3976e9d62f7d2e51753f4f703d5 Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Fri, 4 Mar 2016 17:15:53 +0100 Subject: [PATCH 52/79] [IMP] Define SEPA identifiers per payment mode --- account_banking_pain_base/README.rst | 3 +- account_banking_pain_base/__openerp__.py | 4 ++- .../models/banking_export_pain.py | 16 +++++---- .../models/payment_mode.py | 35 ++++++++++++++++++- .../views/payment_mode_view.xml | 11 ++++++ 5 files changed, 59 insertions(+), 10 deletions(-) diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index fb9b48a2d..df673dbf2 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -39,7 +39,7 @@ Known issues / Roadmap ====================== * no known issues - + Bug Tracker =========== @@ -62,6 +62,7 @@ Contributors * Raphaël Valyi * Sandy Carter * Stefan Rijnhart (Therp) +* Antonio Espinosa Maintainer ---------- diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 6ee208c1c..1e129f554 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -1,16 +1,18 @@ # -*- coding: utf-8 -*- # © 2013-2015 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '8.0.0.3.0', + 'version': '8.0.0.4.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', 'contributors': ['Pedro M. Baeza '], diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index 6d2ea34ab..c25229c42 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # © 2013-2015 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api, _ @@ -234,12 +235,13 @@ class BankingExportPain(models.AbstractModel): initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name - initiating_party_identifier =\ - self.payment_order_ids[0].company_id.\ - initiating_party_identifier - initiating_party_issuer =\ - self.payment_order_ids[0].company_id.\ - initiating_party_issuer + payment = self.payment_order_ids[0] + initiating_party_identifier = ( + payment.mode.initiating_party_identifier or + payment.company_id.initiating_party_identifier) + initiating_party_issuer = ( + payment.mode.initiating_party_issuer or + payment.company_id.initiating_party_issuer) if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') @@ -254,7 +256,7 @@ class BankingExportPain(models.AbstractModel): _("Missing 'Initiating Party Issuer' and/or " "'Initiating Party Identifier' for the company '%s'. " "Both fields must have a value.") - % self.payment_order_ids[0].company_id.name) + % payment.company_id.name) return True @api.model diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/payment_mode.py index 1ccc72fe5..832ff2bc9 100644 --- a/account_banking_pain_base/models/payment_mode.py +++ b/account_banking_pain_base/models/payment_mode.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- # © 2013-2015 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from openerp import models, fields, api class PaymentMode(models.Model): @@ -14,3 +15,35 @@ class PaymentMode(models.Model): help="If active, Odoo will convert each accented caracter to " "the corresponding unaccented caracter, so that only ASCII " "caracters are used in the generated PAIN file.") + initiating_party_issuer = fields.Char( + string='Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by Odoo. If not defined, Initiating Party " + "Issuer from company will be used.\n" + "Common format (13): \n" + "- Country code (2, optional)\n" + "- Company idenfier (N, VAT)\n" + "- Service suffix (N, issued by bank)") + initiating_party_identifier = fields.Char( + string='Initiating Party Identifier', size=35, + help="This will be used as the 'Initiating Party Identifier' in " + "the PAIN files generated by Odoo. If not defined, Initiating Party " + "Identifier from company will be used.\n" + "Common format (13): \n" + "- Country code (2, optional)\n" + "- Company idenfier (N, VAT)\n" + "- Service suffix (N, issued by bank)") + sepa_type = fields.Char(compute="_compute_sepa_type") + + def _sepa_type_get(self): + """Defined to be inherited by child addons, for instance: + - account_banking_sepa_credit_transfer + - account_banking_sepa_direct_debit + """ + return False + + @api.multi + @api.depends('type') + def _compute_sepa_type(self): + for mode in self: + mode.sepa_type = mode._sepa_type_get() diff --git a/account_banking_pain_base/views/payment_mode_view.xml b/account_banking_pain_base/views/payment_mode_view.xml index 2deb24999..3ab148671 100644 --- a/account_banking_pain_base/views/payment_mode_view.xml +++ b/account_banking_pain_base/views/payment_mode_view.xml @@ -2,6 +2,7 @@ @@ -15,6 +16,16 @@ + + + + + + + + + From f319243b720f4b088445f783a87d91f28019865e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 30 Apr 2016 01:46:34 +0200 Subject: [PATCH 53/79] Start to port bank-payment to v9 (with a lot of improvements) during the Sorrento Code sprint 2016 Improvements include: - full re-organisation of modules and big re-organisation of the code - simplification of the code related to the fact that support for direct debit is now in t he base module, not added by an optional module account_direct_debit (module was removed) - new design of the wizard to select move lines to pay - support for non-SEPA file transfer- - support for German direct debit SEPA files (fixes bug #129) - remove workflow of payment.order This port to v9 is not finished... there is still a lot of work: - finish the code of account_payment_order/wizard/account_payment_line_create.py - port account_banking_payment_transfer and integrate it inside account_payment_order - fix bugs - clean-up code, remove dead code - test in several complex scenarios --- account_banking_pain_base/__openerp__.py | 14 +-- account_banking_pain_base/models/__init__.py | 8 +- .../models/account_payment_line.py | 23 ++++ .../models/account_payment_method.py | 19 ++++ ...ayment_mode.py => account_payment_mode.py} | 31 +++--- .../models/account_payment_order.py | 55 ++++++++++ .../models/bank_payment_line.py | 5 +- .../models/banking_export_pain.py | 100 ++++++------------ .../models/payment_line.py | 26 ----- account_banking_pain_base/post_install.py | 2 +- .../views/account_payment_line.xml | 22 ++++ .../views/account_payment_method.xml | 30 ++++++ .../views/account_payment_mode.xml | 30 ++++++ .../views/account_payment_order.xml | 24 +++++ .../views/bank_payment_line_view.xml | 9 +- .../views/payment_line_view.xml | 26 ----- .../views/payment_mode_view.xml | 33 ------ 17 files changed, 268 insertions(+), 189 deletions(-) create mode 100644 account_banking_pain_base/models/account_payment_line.py create mode 100644 account_banking_pain_base/models/account_payment_method.py rename account_banking_pain_base/models/{payment_mode.py => account_payment_mode.py} (69%) create mode 100644 account_banking_pain_base/models/account_payment_order.py delete mode 100644 account_banking_pain_base/models/payment_line.py create mode 100644 account_banking_pain_base/views/account_payment_line.xml create mode 100644 account_banking_pain_base/views/account_payment_method.xml create mode 100644 account_banking_pain_base/views/account_payment_mode.xml create mode 100644 account_banking_pain_base/views/account_payment_order.xml delete mode 100644 account_banking_pain_base/views/payment_line_view.xml delete mode 100644 account_banking_pain_base/views/payment_mode_view.xml diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 1e129f554..809182e29 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -7,7 +7,7 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '8.0.0.4.0', + 'version': '9.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " @@ -17,16 +17,18 @@ 'website': 'https://github.com/OCA/bank-payment', 'contributors': ['Pedro M. Baeza '], 'category': 'Hidden', - 'depends': ['account_banking_payment_export'], + 'depends': ['account_payment_order'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], }, 'data': [ - 'views/payment_line_view.xml', + 'views/account_payment_line.xml', + 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', - 'views/payment_mode_view.xml', + 'views/account_payment_mode.xml', 'views/res_company_view.xml', + 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'installable': False, + 'installable': True, } diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index ffc2334f3..caf442d40 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- -# © 2013 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import payment_line +from . import account_payment_line +from . import account_payment_order from . import bank_payment_line -from . import payment_mode +from . import account_payment_mode from . import res_company from . import banking_export_pain from . import res_partner_bank +from . import account_payment_method diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py new file mode 100644 index 000000000..da183051c --- /dev/null +++ b/account_banking_pain_base/models/account_payment_line.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# © 2013-2016 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields + + +class AccountPaymentLine(models.Model): + _inherit = 'account.payment.line' + + priority = fields.Selection([ + ('NORM', 'Normal'), + ('HIGH', 'High')], + string='Priority', default='NORM', + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file.") + # PAIN allows 140 caracters + communication = fields.Char(size=140) + # The field struct_communication_type has been dropped in v9 + # We now use communication_type ; you should add an option + # in communication_type with selection_add=[] + communication_type = fields.Selection(selection_add=[('ISO', 'ISO')]) diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py new file mode 100644 index 000000000..90b485fa0 --- /dev/null +++ b/account_banking_pain_base/models/account_payment_method.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import UserError + + +class AccountPaymentMethod(models.Model): + _inherit = 'account.payment.method' + + pain_version = fields.Selection([], string='PAIN Version') + + @api.multi + def get_xsd_file_path(self): + """This method is designed to be inherited in the SEPA modules""" + self.ensure_one() + raise UserError(_( + "No XSD file path found for payment method '%s'") % self.name) diff --git a/account_banking_pain_base/models/payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py similarity index 69% rename from account_banking_pain_base/models/payment_mode.py rename to account_banking_pain_base/models/account_payment_mode.py index 832ff2bc9..48febc536 100644 --- a/account_banking_pain_base/models/payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -7,8 +7,8 @@ from openerp import models, fields, api -class PaymentMode(models.Model): - _inherit = 'payment.mode' +class AccountPaymentMode(models.Model): + _inherit = 'account.payment.mode' convert_to_ascii = fields.Boolean( string='Convert to ASCII', default=True, @@ -33,17 +33,18 @@ class PaymentMode(models.Model): "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)") - sepa_type = fields.Char(compute="_compute_sepa_type") + # I plan to change this -- Alexis + #sepa_type = fields.Char(compute="_compute_sepa_type") - def _sepa_type_get(self): - """Defined to be inherited by child addons, for instance: - - account_banking_sepa_credit_transfer - - account_banking_sepa_direct_debit - """ - return False + #def _sepa_type_get(self): + # """Defined to be inherited by child addons, for instance: + # - account_banking_sepa_credit_transfer + # - account_banking_sepa_direct_debit + # """ + # return False - @api.multi - @api.depends('type') - def _compute_sepa_type(self): - for mode in self: - mode.sepa_type = mode._sepa_type_get() + #@api.multi + #@api.depends('type') + #def _compute_sepa_type(self): + # for mode in self: + # mode.sepa_type = mode._sepa_type_get() diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py new file mode 100644 index 000000000..a7e7106b9 --- /dev/null +++ b/account_banking_pain_base/models/account_payment_order.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# © 2013-2016 Akretion - Alexis de Lattre +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api + + +class AccountPaymentOrder(models.Model): + _inherit = 'account.payment.order' + + sepa = fields.Boolean( + compute='compute_sepa', readonly=True, + string="SEPA Payment") + charge_bearer = fields.Selection([ + ('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], string='Charge Bearer', + default='SLEV', + help="Following service level : transaction charges are to be " + "applied following the rules agreed in the service level " + "and/or scheme (SEPA Core messages must use this). Shared : " + "transaction charges on the debtor side are to be borne by " + "the debtor, transaction charges on the creditor side are to " + "be borne by the creditor. Borne by creditor : all " + "transaction charges are to be borne by the creditor. Borne " + "by debtor : all transaction charges are to be borne by the " + "debtor.") + batch_booking = fields.Boolean( + string='Batch Booking', + help="If true, the bank statement will display only one debit " + "line for all the wire transfers of the SEPA XML file ; if " + "false, the bank statement will display one debit line per wire " + "transfer of the SEPA XML file.") + + @api.multi + @api.depends( + 'company_partner_bank_id.acc_type', + 'payment_line_ids.currency_id', + 'payment_line_ids.partner_bank_id.acc_type') + def compute_sepa(self): + eur = self.env.ref('base.EUR') + for order in self: + sepa = True + if order.company_partner_bank_id.acc_type != 'iban': + sepa = False + for pline in order.payment_line_ids: + if pline.currency_id != eur: + sepa = False + break + if pline.partner_bank_id.acc_type != 'iban': + sepa = False + break + self.sepa = sepa diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index e67a46be6..7885d701a 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -10,13 +10,10 @@ class BankPaymentLine(models.Model): priority = fields.Selection( related='payment_line_ids.priority', string='Priority') - struct_communication_type = fields.Selection( - related='payment_line_ids.struct_communication_type', - string='Structured Communication Type') @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', 'struct_communication_type'] + res += ['priority'] return res diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index c25229c42..af178327d 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api, _ -from openerp.exceptions import Warning +from openerp.exceptions import UserError from openerp.tools.safe_eval import safe_eval from datetime import datetime from lxml import etree from openerp import tools import logging -import base64 try: @@ -22,17 +21,8 @@ except ImportError: logger = logging.getLogger(__name__) -class BankingExportPain(models.AbstractModel): - _name = 'banking.export.pain' - - @api.model - def _validate_iban(self, iban): - """if IBAN is valid, returns IBAN - if IBAN is NOT valid, raises an error message""" - if self.env['res.partner.bank'].is_iban_valid(iban): - return iban.replace(' ', '') - else: - raise Warning(_("This IBAN is not valid : %s") % iban) +class AccountPaymentOrder(models.Model): + _inherit = 'account.payment.order' @api.model def _prepare_field(self, field_name, field_value, eval_ctx, @@ -58,20 +48,20 @@ class BankingExportPain(models.AbstractModel): except: line = eval_ctx.get('line') if line: - raise Warning( + raise UserError( _("Cannot compute the '%s' of the Payment Line with " "reference '%s'.") % (field_name, line.name)) else: - raise Warning( + raise UserError( _("Cannot compute the '%s'.") % field_name) if not isinstance(value, (str, unicode)): - raise Warning( + raise UserError( _("The type of the field '%s' is %s. It should be a string " "or unicode.") % (field_name, type(value))) if not value: - raise Warning( + raise UserError( _("The '%s' is empty or 0. It should have a non-null value.") % field_name) if max_size and len(value) > max_size: @@ -92,7 +82,7 @@ class BankingExportPain(models.AbstractModel): "The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) logger.warning(e) - raise Warning( + raise UserError( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. Here " @@ -102,8 +92,7 @@ class BankingExportPain(models.AbstractModel): return True @api.multi - def finalize_sepa_file_creation( - self, xml_root, total_amount, transactions_count, gen_args): + def finalize_sepa_file_creation(self, xml_root, gen_args): xml_string = etree.tostring( xml_root, pretty_print=True, encoding='UTF-8', xml_declaration=True) @@ -113,30 +102,8 @@ class BankingExportPain(models.AbstractModel): logger.debug(xml_string) self._validate_xml(xml_string, gen_args) - order_ref = [] - for order in self.payment_order_ids: - if order.reference: - order_ref.append(order.reference.replace('/', '-')) - filename = '%s%s.xml' % (gen_args['file_prefix'], '-'.join(order_ref)) - - self.write({ - 'nb_transactions': transactions_count, - 'total_amount': total_amount, - 'filename': filename, - 'file': base64.encodestring(xml_string), - 'state': 'finish', - }) - - action = { - 'name': _('SEPA File'), - 'type': 'ir.actions.act_window', - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': self._name, - 'res_id': self.ids[0], - 'target': 'new', - } - return action + filename = '%s%s.xml' % (gen_args['file_prefix'], self.name) + return (xml_string, filename) @api.model def generate_group_header_block(self, parent_node, gen_args): @@ -145,7 +112,7 @@ class BankingExportPain(models.AbstractModel): group_header_1_0, 'MsgId') message_identification_1_1.text = self._prepare_field( 'Message Identification', - 'self.payment_order_ids[0].reference', + 'self.name', {'self': self}, 35, gen_args=gen_args) creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') creation_date_time_1_2.text = datetime.strftime( @@ -196,10 +163,11 @@ class BankingExportPain(models.AbstractModel): instruction_priority_2_7 = etree.SubElement( payment_type_info_2_6, 'InstrPrty') instruction_priority_2_7.text = priority - service_level_2_8 = etree.SubElement( - payment_type_info_2_6, 'SvcLvl') - service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') - service_level_code_2_9.text = 'SEPA' + if self.sepa: + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' if local_instrument: local_instrument_2_11 = etree.SubElement( payment_type_info_2_6, 'LclInstrm') @@ -230,18 +198,17 @@ class BankingExportPain(models.AbstractModel): def generate_initiating_party_block(self, parent_node, gen_args): my_company_name = self._prepare_field( 'Company Name', - 'self.payment_order_ids[0].mode.bank_id.partner_id.name', + 'self.company_partner_bank_id.partner_id.name', {'self': self}, gen_args.get('name_maxsize'), gen_args=gen_args) initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') initiating_party_name.text = my_company_name - payment = self.payment_order_ids[0] initiating_party_identifier = ( - payment.mode.initiating_party_identifier or - payment.company_id.initiating_party_identifier) + self.payment_mode_id.initiating_party_identifier or + self.payment_mode_id.company_id.initiating_party_identifier) initiating_party_issuer = ( - payment.mode.initiating_party_issuer or - payment.company_id.initiating_party_issuer) + self.payment_mode_id.initiating_party_issuer or + self.payment_mode_id.company_id.initiating_party_issuer) if initiating_party_identifier and initiating_party_issuer: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') @@ -252,11 +219,11 @@ class BankingExportPain(models.AbstractModel): iniparty_org_other, 'Issr') iniparty_org_other_issuer.text = initiating_party_issuer elif self._must_have_initiating_party(gen_args): - raise Warning( + raise UserError( _("Missing 'Initiating Party Issuer' and/or " "'Initiating Party Identifier' for the company '%s'. " "Both fields must have a value.") - % payment.company_id.name) + % self.company_id.name) return True @api.model @@ -275,11 +242,10 @@ class BankingExportPain(models.AbstractModel): party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) party_agent_bic.text = bic - except Warning: + except UserError: if order == 'C': if iban[0:2] != gen_args['initiating_party_country_code']: - raise Warning( - _('Error:'), + raise UserError( _("The bank account with IBAN '%s' of partner '%s' " "must have an associated BIC because it is a " "cross-border SEPA operation.") @@ -314,9 +280,10 @@ class BankingExportPain(models.AbstractModel): party_name = self._prepare_field( '%s Name' % party_type_label, name, eval_ctx, gen_args.get('name_maxsize'), gen_args=gen_args) - piban = self._prepare_field( + viban = self._prepare_field( '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args) - viban = self._validate_iban(piban) + # TODO : add support for bank accounts other than IBAN + #viban = self._validate_iban(piban) # At C level, the order is : BIC, Name, IBAN # At B level, the order is : Name, IBAN, BIC if order == 'B': @@ -353,11 +320,6 @@ class BankingExportPain(models.AbstractModel): 'line.communication', {'line': line}, 140, gen_args=gen_args) else: - if not line.struct_communication_type: - raise Warning( - _("Missing 'Structured Communication Type' on payment " - "line with reference '%s'.") - % line.name) remittance_info_structured_2_100 = etree.SubElement( remittance_info_2_91, 'Strd') creditor_ref_information_2_120 = etree.SubElement( @@ -385,7 +347,7 @@ class BankingExportPain(models.AbstractModel): creditor_ref_info_type_code_2_123.text = 'SCOR' creditor_ref_info_type_issuer_2_125.text = \ - line.struct_communication_type + line.communication_type creditor_reference_2_126.text = \ self._prepare_field( 'Creditor Structured Reference', diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py deleted file mode 100644 index 70f214721..000000000 --- a/account_banking_pain_base/models/payment_line.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openerp import models, fields, api - - -class PaymentLine(models.Model): - _inherit = 'payment.line' - - @api.model - def _get_struct_communication_types(self): - return [('ISO', 'ISO')] - - priority = fields.Selection([ - ('NORM', 'Normal'), - ('HIGH', 'High')], - string='Priority', default='NORM', - help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file.") - # Update size from 64 to 140, because PAIN allows 140 caracters - communication = fields.Char(size=140) - struct_communication_type = fields.Selection( - '_get_struct_communication_types', - string='Structured Communication Type', default='ISO') diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index 90e46fec2..14a9259f9 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2015 Akretion - Alexis de Lattre +# © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml new file mode 100644 index 000000000..6adab6916 --- /dev/null +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -0,0 +1,22 @@ + + + + + + + pain.base.account.payment.line + account.payment.line + + + + + + + + + + diff --git a/account_banking_pain_base/views/account_payment_method.xml b/account_banking_pain_base/views/account_payment_method.xml new file mode 100644 index 000000000..7a9e65982 --- /dev/null +++ b/account_banking_pain_base/views/account_payment_method.xml @@ -0,0 +1,30 @@ + + + + + + + pain_base.account_payment_method.form + account.payment.method + + + + + + + + + + pain_base.account_payment_method.tree + account.payment.method + + + + + + + + + + + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml new file mode 100644 index 000000000..d92a5e786 --- /dev/null +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -0,0 +1,30 @@ + + + + + + + + pain_base.account.payment.mode.form + account.payment.mode + + + + + + + + + + + + + + + + diff --git a/account_banking_pain_base/views/account_payment_order.xml b/account_banking_pain_base/views/account_payment_order.xml new file mode 100644 index 000000000..e99928637 --- /dev/null +++ b/account_banking_pain_base/views/account_payment_order.xml @@ -0,0 +1,24 @@ + + + + + + + pain.base.account.payment.order.form + account.payment.order + + + + + + + + + + + + diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index 65e993ad6..17d4e3049 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -1,6 +1,6 @@ @@ -10,14 +10,11 @@ pain.base.bank.payment.line.form bank.payment.line - + - + - - - diff --git a/account_banking_pain_base/views/payment_line_view.xml b/account_banking_pain_base/views/payment_line_view.xml deleted file mode 100644 index 03759b568..000000000 --- a/account_banking_pain_base/views/payment_line_view.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - pain.base.payment.line.inside.order.form - payment.order - - - - - - - - - - - - - - diff --git a/account_banking_pain_base/views/payment_mode_view.xml b/account_banking_pain_base/views/payment_mode_view.xml deleted file mode 100644 index 3ab148671..000000000 --- a/account_banking_pain_base/views/payment_mode_view.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - add.convert_to_ascii.in.payment.mode.form - payment.mode - - - - - - - - - - - - - - - - - - - From 30c723a562279a1019c8b7382727196dfccf8b47 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 6 May 2016 01:16:20 +0200 Subject: [PATCH 54/79] Finalise the wizard of selection of move lines to pay Add button "Add to payment/debit order" on invoice form view Started to integrate payment transfer in account_payment_order (not finished at all though) Various fixes/changes/improvements/... --- account_banking_pain_base/README.rst | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index df673dbf2..36f50e1d9 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -16,7 +16,8 @@ Installation ============ This module depends on : -- account_banking_payment_export + +- account_payment_order This module is part of the OCA/bank-payment suite. @@ -30,11 +31,6 @@ Usage See 'readme' files of the OCA/bank-payment suite. - -For further information, please visit: - - * https://www.odoo.com/forum/help-1 - Known issues / Roadmap ====================== @@ -46,7 +42,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +`here `_. Credits ======= @@ -54,7 +50,7 @@ Credits Contributors ------------ -* Alexis de Lattre +* Alexis de Lattre * Pedro M. Baeza * Stéphane Bidoul * Ignacio Ibeas - Acysos S.L. From d616d195648686820fc4fb68d0b8bb6efa2d6906 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 6 May 2016 12:37:31 +0200 Subject: [PATCH 55/79] bank_bic on res.partner.bank is a related field in v9 and is not displayed in form view, so no need for explainations any more --- account_banking_pain_base/models/__init__.py | 1 - .../models/res_partner_bank.py | 20 ------------------- 2 files changed, 21 deletions(-) delete mode 100644 account_banking_pain_base/models/res_partner_bank.py diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index caf442d40..e1677f11e 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -8,5 +8,4 @@ from . import bank_payment_line from . import account_payment_mode from . import res_company from . import banking_export_pain -from . import res_partner_bank from . import account_payment_method diff --git a/account_banking_pain_base/models/res_partner_bank.py b/account_banking_pain_base/models/res_partner_bank.py deleted file mode 100644 index 76722a561..000000000 --- a/account_banking_pain_base/models/res_partner_bank.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2013 ACSONE SA/NV () -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -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.") From de23d92e82bc71793cf004f035332bc38232376f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 6 May 2016 22:14:56 +0200 Subject: [PATCH 56/79] Finalise merge of account_banking_payment_transfer into account_payment_order Add support for transfer moves Display transfer moves in a dedicated tab in payment order view Code cleanup --- .../models/account_payment_mode.py | 17 +---------------- .../models/banking_export_pain.py | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index 48febc536..fd36ea3cd 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -4,7 +4,7 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from openerp import models, fields class AccountPaymentMode(models.Model): @@ -33,18 +33,3 @@ class AccountPaymentMode(models.Model): "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)") - # I plan to change this -- Alexis - #sepa_type = fields.Char(compute="_compute_sepa_type") - - #def _sepa_type_get(self): - # """Defined to be inherited by child addons, for instance: - # - account_banking_sepa_credit_transfer - # - account_banking_sepa_direct_debit - # """ - # return False - - #@api.multi - #@api.depends('type') - #def _compute_sepa_type(self): - # for mode in self: - # mode.sepa_type = mode._sepa_type_get() diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index af178327d..ab3a05383 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -283,7 +283,7 @@ class AccountPaymentOrder(models.Model): viban = self._prepare_field( '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args) # TODO : add support for bank accounts other than IBAN - #viban = self._validate_iban(piban) + # viban = self._validate_iban(piban) # At C level, the order is : BIC, Name, IBAN # At B level, the order is : Name, IBAN, BIC if order == 'B': From d7b616102c379eca99784e90f3dfabd43d9a5564 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 7 May 2016 23:55:46 +0200 Subject: [PATCH 57/79] Add module account_banking_mandate_sale Add option 'mandate_required' on payment orders Autoselect first valid mandate on customer invoice that have a payment mode 'mandate_required' = True Add option on select move lines to pay wizard to allow selection of litigation moves (unchecked by default), in order to integrate the feature of the module account_payment_blocking --- account_banking_pain_base/README.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index 36f50e1d9..f9e08a6b6 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -31,6 +31,10 @@ Usage See 'readme' files of the OCA/bank-payment suite. +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/173/9.0 + Known issues / Roadmap ====================== @@ -39,10 +43,14 @@ Known issues / Roadmap Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. Credits ======= @@ -52,7 +60,7 @@ Contributors * Alexis de Lattre * Pedro M. Baeza -* Stéphane Bidoul +* Stéphane Bidoul * Ignacio Ibeas - Acysos S.L. * Alexandre Fayolle * Raphaël Valyi From 7c3a7892a6a1b8ecbbed93ce2d988e79bf5ee24e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 9 May 2016 23:23:43 +0200 Subject: [PATCH 58/79] Add support for non-SEPA DD and CT without without IBANs --- .../models/banking_export_pain.py | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index ab3a05383..db24b2f44 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -228,28 +228,22 @@ class AccountPaymentOrder(models.Model): @api.model def generate_party_agent( - self, parent_node, party_type, party_type_label, - order, party_name, iban, bic, eval_ctx, gen_args): + self, parent_node, party_type, order, partner_bank, gen_args): """Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD""" + This code is mutualized between TRF and DD + Starting from Feb 1st 2016, we should be able to do + cross-border SEPA transfers without BIC, cf + http://www.europeanpaymentscouncil.eu/index.cfm/ + sepa-credit-transfer/iban-and-bic/""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" - try: - bic = self._prepare_field( - '%s BIC' % party_type_label, bic, eval_ctx, gen_args=gen_args) + if partner_bank.bank_bic: party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) party_agent_institution = etree.SubElement( party_agent, 'FinInstnId') party_agent_bic = etree.SubElement( party_agent_institution, gen_args.get('bic_xml_tag')) - party_agent_bic.text = bic - except UserError: - if order == 'C': - if iban[0:2] != gen_args['initiating_party_country_code']: - raise UserError( - _("The bank account with IBAN '%s' of partner '%s' " - "must have an associated BIC because it is a " - "cross-border SEPA operation.") - % (iban, party_name)) + party_agent_bic.text = partner_bank.bank_bic + else: if order == 'B' or ( order == 'C' and gen_args['payment_method'] == 'DD'): party_agent = etree.SubElement( @@ -268,8 +262,7 @@ class AccountPaymentOrder(models.Model): @api.model def generate_party_block( - self, parent_node, party_type, order, name, iban, bic, - eval_ctx, gen_args): + self, parent_node, party_type, order, partner_bank, gen_args): """Generate the piece of the XML file corresponding to Name+IBAN+BIC This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" @@ -277,34 +270,35 @@ class AccountPaymentOrder(models.Model): party_type_label = 'Creditor' elif party_type == 'Dbtr': party_type_label = 'Debtor' + name = 'partner_bank.partner_id.name' + eval_ctx = {'partner_bank': partner_bank} party_name = self._prepare_field( '%s Name' % party_type_label, name, eval_ctx, gen_args.get('name_maxsize'), gen_args=gen_args) - viban = self._prepare_field( - '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args) - # TODO : add support for bank accounts other than IBAN - # viban = self._validate_iban(piban) # At C level, the order is : BIC, Name, IBAN # At B level, the order is : Name, IBAN, BIC - if order == 'B': - gen_args['initiating_party_country_code'] = viban[0:2] - elif order == 'C': + if order == 'C': self.generate_party_agent( - parent_node, party_type, party_type_label, - order, party_name, viban, bic, eval_ctx, gen_args) + parent_node, party_type, order, partner_bank, gen_args) party = etree.SubElement(parent_node, party_type) party_nm = etree.SubElement(party, 'Nm') party_nm.text = party_name party_account = etree.SubElement( parent_node, '%sAcct' % party_type) party_account_id = etree.SubElement(party_account, 'Id') - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') - party_account_iban.text = viban + if partner_bank.acc_type == 'iban': + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = partner_bank.sanitized_acc_number + else: + party_account_other = etree.SubElement( + party_account_id, 'Othr') + party_account_other_id = etree.SubElement( + party_account_other, 'Id') + party_account_other_id.text = partner_bank.sanitized_acc_number if order == 'B': self.generate_party_agent( - parent_node, party_type, party_type_label, - order, party_name, viban, bic, eval_ctx, gen_args) + parent_node, party_type, order, partner_bank, gen_args) return True @api.model From 71d1e3883d62476ff98633fa96464229613e75c7 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 10 May 2016 23:16:31 +0200 Subject: [PATCH 59/79] Move fields mandate_required and export_ascii from payment mode to payment method Display chatter on payment orders Several small usability improvements --- .../models/account_payment_method.py | 5 +++++ .../models/account_payment_mode.py | 5 ----- .../models/account_payment_order.py | 11 +++++++---- .../views/account_payment_method.xml | 2 ++ .../views/account_payment_mode.xml | 1 - 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 90b485fa0..2d517e3db 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -10,6 +10,11 @@ class AccountPaymentMethod(models.Model): _inherit = 'account.payment.method' pain_version = fields.Selection([], string='PAIN Version') + convert_to_ascii = fields.Boolean( + string='Convert to ASCII', default=True, + help="If active, Odoo will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file.") @api.multi def get_xsd_file_path(self): diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index fd36ea3cd..e0e628a59 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -10,11 +10,6 @@ from openerp import models, fields class AccountPaymentMode(models.Model): _inherit = 'account.payment.mode' - convert_to_ascii = fields.Boolean( - string='Convert to ASCII', default=True, - help="If active, Odoo will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file.") initiating_party_issuer = fields.Char( string='Initiating Party Issuer', size=35, help="This will be used as the 'Initiating Party Issuer' in the " diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index a7e7106b9..d4ea8e6e5 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -10,14 +10,15 @@ class AccountPaymentOrder(models.Model): _inherit = 'account.payment.order' sepa = fields.Boolean( - compute='compute_sepa', readonly=True, - string="SEPA Payment") + compute='compute_sepa', readonly=True, string="SEPA Payment") charge_bearer = fields.Selection([ ('SLEV', 'Following Service Level'), ('SHAR', 'Shared'), ('CRED', 'Borne by Creditor'), ('DEBT', 'Borne by Debtor')], string='Charge Bearer', - default='SLEV', + default='SLEV', readonly=True, + states={'draft': [('readonly', False)], 'open': [('readonly', False)]}, + track_visibility='onchange', help="Following service level : transaction charges are to be " "applied following the rules agreed in the service level " "and/or scheme (SEPA Core messages must use this). Shared : " @@ -28,7 +29,9 @@ class AccountPaymentOrder(models.Model): "by debtor : all transaction charges are to be borne by the " "debtor.") batch_booking = fields.Boolean( - string='Batch Booking', + string='Batch Booking', readonly=True, + states={'draft': [('readonly', False)], 'open': [('readonly', False)]}, + track_visibility='onchange', help="If true, the bank statement will display only one debit " "line for all the wire transfers of the SEPA XML file ; if " "false, the bank statement will display one debit line per wire " diff --git a/account_banking_pain_base/views/account_payment_method.xml b/account_banking_pain_base/views/account_payment_method.xml index 7a9e65982..8d223b2b0 100644 --- a/account_banking_pain_base/views/account_payment_method.xml +++ b/account_banking_pain_base/views/account_payment_method.xml @@ -10,6 +10,8 @@ + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index d92a5e786..cc7346dd6 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -16,7 +16,6 @@ - From 9703a0f56d166c286fd04c8818a9e2f020979786 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 10 May 2016 23:28:38 +0200 Subject: [PATCH 60/79] Avoid empty group in payment mode Code cleanup in views --- .../views/account_payment_mode.xml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index cc7346dd6..29546b84e 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -14,12 +14,10 @@ account.payment.mode - - - - - - + + + + From 075871ad6479a6f4337839e4d0884de3e11097e0 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 11 May 2016 22:59:15 +0200 Subject: [PATCH 61/79] FIX use of communication type --- account_banking_pain_base/models/banking_export_pain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index db24b2f44..dcfa78208 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -305,7 +305,7 @@ class AccountPaymentOrder(models.Model): def generate_remittance_info_block(self, parent_node, line, gen_args): remittance_info_2_91 = etree.SubElement( parent_node, 'RmtInf') - if line.state == 'normal': + if line.communication_type == 'normal': remittance_info_unstructured_2_99 = etree.SubElement( remittance_info_2_91, 'Ustrd') remittance_info_unstructured_2_99.text = \ From e2b1b44653db33bbdae7c21f89f0bf9c5f457c49 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 23 May 2016 10:42:28 +0200 Subject: [PATCH 62/79] Take into accounts the remarks of Eric Caudal --- account_banking_pain_base/README.rst | 7 ++----- account_banking_pain_base/models/account_payment_line.py | 4 ++-- account_banking_pain_base/models/account_payment_method.py | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index f9e08a6b6..5e7f4774c 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -1,6 +1,7 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 +================================ Account Banking PAIN Base Module ================================ @@ -46,11 +47,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index da183051c..9ecf53d86 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -13,9 +13,9 @@ class AccountPaymentLine(models.Model): ('NORM', 'Normal'), ('HIGH', 'High')], string='Priority', default='NORM', - help="This field will be used as the 'Instruction Priority' in " + help="This field will be used as 'Instruction Priority' in " "the generated PAIN file.") - # PAIN allows 140 caracters + # PAIN allows 140 characters communication = fields.Char(size=140) # The field struct_communication_type has been dropped in v9 # We now use communication_type ; you should add an option diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 2d517e3db..9d9499036 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -12,9 +12,9 @@ class AccountPaymentMethod(models.Model): pain_version = fields.Selection([], string='PAIN Version') convert_to_ascii = fields.Boolean( string='Convert to ASCII', default=True, - help="If active, Odoo will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file.") + help="If active, Odoo will convert each accented character to " + "the corresponding unaccented character, so that only ASCII " + "characters are used in the generated PAIN file.") @api.multi def get_xsd_file_path(self): From f6143e4e066c22bf044127946248a76ead0960e1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Jun 2016 23:58:02 +0200 Subject: [PATCH 63/79] Add hooks for l10n_ch_sepa (pain.001.001.03.ch.02) Move code of account_banking_pain_base/models/banking_export_pain.py to account_banking_pain_base/models/account_payment_order.py Allow cancel when payment order is in "File Generated" state Add postal address in party block --- account_banking_pain_base/models/__init__.py | 1 - .../models/account_payment_order.py | 422 +++++++++++++++++- .../models/banking_export_pain.py | 366 --------------- 3 files changed, 421 insertions(+), 368 deletions(-) delete mode 100644 account_banking_pain_base/models/banking_export_pain.py diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index e1677f11e..1e4dfae26 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -7,5 +7,4 @@ from . import account_payment_order from . import bank_payment_line from . import account_payment_mode from . import res_company -from . import banking_export_pain from . import account_payment_method diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index d4ea8e6e5..d3611ba54 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -1,9 +1,24 @@ # -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from openerp import models, fields, api, _ +from openerp.exceptions import UserError +from openerp.tools.safe_eval import safe_eval +from datetime import datetime +from lxml import etree +from openerp import tools +import logging + + +try: + from unidecode import unidecode +except ImportError: + unidecode = None + +logger = logging.getLogger(__name__) class AccountPaymentOrder(models.Model): @@ -55,4 +70,409 @@ class AccountPaymentOrder(models.Model): if pline.partner_bank_id.acc_type != 'iban': sepa = False break + sepa = order.compute_sepa_final_hook(sepa) self.sepa = sepa + + @api.multi + def compute_sepa_final_hook(self, sepa): + self.ensure_one() + return sepa + + @api.model + def _prepare_field(self, field_name, field_value, eval_ctx, + max_size=0, gen_args=None): + """This function is designed to be inherited !""" + if gen_args is None: + gen_args = {} + assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' + try: + value = safe_eval(field_value, eval_ctx) + # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters + # But we are dealing with banks... + # and many banks don't want non-ASCCI characters ! + # cf section 1.4 "Character set" of the SEPA Credit Transfer + # Scheme Customer-to-bank guidelines + if gen_args.get('convert_to_ascii'): + value = unidecode(value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') + except: + line = eval_ctx.get('line') + if line: + raise UserError( + _("Cannot compute the '%s' of the Payment Line with " + "reference '%s'.") + % (field_name, line.name)) + else: + raise UserError( + _("Cannot compute the '%s'.") % field_name) + if not isinstance(value, (str, unicode)): + raise UserError( + _("The type of the field '%s' is %s. It should be a string " + "or unicode.") + % (field_name, type(value))) + if not value: + raise UserError( + _("The '%s' is empty or 0. It should have a non-null value.") + % field_name) + if max_size and len(value) > max_size: + value = value[0:max_size] + return value + + @api.model + def _validate_xml(self, xml_string, gen_args): + xsd_etree_obj = etree.parse( + tools.file_open(gen_args['pain_xsd_file'])) + official_pain_schema = etree.XMLSchema(xsd_etree_obj) + + try: + root_to_validate = etree.fromstring(xml_string) + official_pain_schema.assertValid(root_to_validate) + except Exception, e: + logger.warning( + "The XML file is invalid against the XML Schema Definition") + logger.warning(xml_string) + logger.warning(e) + raise UserError( + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. Here " + "is the error, which may give you an idea on the cause " + "of the problem : %s") + % unicode(e)) + return True + + @api.multi + def finalize_sepa_file_creation(self, xml_root, gen_args): + xml_string = etree.tostring( + xml_root, pretty_print=True, encoding='UTF-8', + xml_declaration=True) + logger.debug( + "Generated SEPA XML file in format %s below" + % gen_args['pain_flavor']) + logger.debug(xml_string) + self._validate_xml(xml_string, gen_args) + + filename = '%s%s.xml' % (gen_args['file_prefix'], self.name) + return (xml_string, filename) + + @api.multi + def generate_pain_nsmap(self): + self.ensure_one() + pain_flavor = self.payment_mode_id.payment_method_id.pain_version + nsmap = { + 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', + None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor, + } + return nsmap + + @api.multi + def generate_pain_attrib(self): + self.ensure_one() + return {} + + @api.model + def generate_group_header_block(self, parent_node, gen_args): + group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') + message_identification_1_1 = etree.SubElement( + group_header_1_0, 'MsgId') + message_identification_1_1.text = self._prepare_field( + 'Message Identification', + 'self.name', + {'self': self}, 35, gen_args=gen_args) + creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') + creation_date_time_1_2.text = datetime.strftime( + datetime.today(), '%Y-%m-%dT%H:%M:%S') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + # batch_booking is in "Group header" with pain.001.001.02 + # and in "Payment info" in pain.001.001.03/04 + batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking.text = unicode(self.batch_booking).lower() + nb_of_transactions_1_6 = etree.SubElement( + group_header_1_0, 'NbOfTxs') + control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + # Grpg removed in pain.001.001.03 + if gen_args.get('pain_flavor') == 'pain.001.001.02': + grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping.text = 'GRPD' + self.generate_initiating_party_block(group_header_1_0, gen_args) + return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + + @api.model + def generate_start_payment_info_block( + self, parent_node, payment_info_ident, + priority, local_instrument, sequence_type, requested_date, + eval_ctx, gen_args): + payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification_2_1 = etree.SubElement( + payment_info_2_0, 'PmtInfId') + payment_info_identification_2_1.text = self._prepare_field( + 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, gen_args=gen_args) + payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') + payment_method_2_2.text = gen_args['payment_method'] + nb_of_transactions_2_4 = False + control_sum_2_5 = False + if gen_args.get('pain_flavor') != 'pain.001.001.02': + batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') + batch_booking_2_3.text = unicode(self.batch_booking).lower() + # The "SEPA Customer-to-bank + # Implementation guidelines" for SCT and SDD says that control sum + # and nb_of_transactions should be present + # at both "group header" level and "payment info" level + nb_of_transactions_2_4 = etree.SubElement( + payment_info_2_0, 'NbOfTxs') + 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 and gen_args['payment_method'] != 'DD': + instruction_priority_2_7 = etree.SubElement( + payment_type_info_2_6, 'InstrPrty') + instruction_priority_2_7.text = priority + if self.sepa: + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' + if local_instrument: + local_instrument_root = etree.SubElement( + payment_type_info_2_6, 'LclInstrm') + if gen_args.get('local_instrument_type') == 'proprietary': + local_instr_value = etree.SubElement( + local_instrument_root, 'Prtry') + else: + local_instr_value = etree.SubElement( + local_instrument_root, 'Cd') + local_instr_value.text = local_instrument + if sequence_type: + sequence_type_2_14 = etree.SubElement( + payment_type_info_2_6, 'SeqTp') + sequence_type_2_14.text = sequence_type + + if gen_args['payment_method'] == 'DD': + request_date_tag = 'ReqdColltnDt' + else: + request_date_tag = 'ReqdExctnDt' + requested_date_2_17 = etree.SubElement( + payment_info_2_0, request_date_tag) + requested_date_2_17.text = requested_date + return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + + @api.model + def _must_have_initiating_party(self, gen_args): + '''This method is designed to be inherited in localization modules for + countries in which the initiating party is required''' + return False + + @api.model + def generate_initiating_party_block(self, parent_node, gen_args): + my_company_name = self._prepare_field( + 'Company Name', + 'self.company_partner_bank_id.partner_id.name', + {'self': self}, gen_args.get('name_maxsize'), gen_args=gen_args) + initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party_name.text = my_company_name + initiating_party_identifier = ( + self.payment_mode_id.initiating_party_identifier or + self.payment_mode_id.company_id.initiating_party_identifier) + initiating_party_issuer = ( + self.payment_mode_id.initiating_party_issuer or + self.payment_mode_id.company_id.initiating_party_issuer) + if initiating_party_identifier and initiating_party_issuer: + iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') + iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') + iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') + iniparty_org_other_id.text = initiating_party_identifier + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer + elif self._must_have_initiating_party(gen_args): + raise UserError( + _("Missing 'Initiating Party Issuer' and/or " + "'Initiating Party Identifier' for the company '%s'. " + "Both fields must have a value.") + % self.company_id.name) + return True + + @api.model + def generate_party_agent( + self, parent_node, party_type, order, partner_bank, gen_args): + """Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD + Starting from Feb 1st 2016, we should be able to do + cross-border SEPA transfers without BIC, cf + http://www.europeanpaymentscouncil.eu/index.cfm/ + sepa-credit-transfer/iban-and-bic/""" + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if partner_bank.bank_bic: + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = partner_bank.bank_bic + else: + if order == 'B' or ( + order == 'C' and gen_args['payment_method'] == 'DD'): + party_agent = etree.SubElement( + parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' + # for Credit Transfers, in the 'C' block, if BIC is not provided, + # we should not put the 'Creditor Agent' block at all, + # as per the guidelines of the EPC + return True + + @api.model + def generate_party_block( + self, parent_node, party_type, order, partner_bank, gen_args): + """Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD""" + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if party_type == 'Cdtr': + party_type_label = 'Creditor' + elif party_type == 'Dbtr': + party_type_label = 'Debtor' + name = 'partner_bank.partner_id.name' + eval_ctx = {'partner_bank': partner_bank} + party_name = self._prepare_field( + '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), gen_args=gen_args) + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'C': + self.generate_party_agent( + parent_node, party_type, order, partner_bank, gen_args) + party = etree.SubElement(parent_node, party_type) + party_nm = etree.SubElement(party, 'Nm') + party_nm.text = party_name + partner = partner_bank.partner_id + if partner.country_id: + postal_address = etree.SubElement(party, 'PstlAdr') + if partner.zip: + post_code = etree.SubElement(postal_address, 'PstCd') + post_code.text = self._prepare_field( + 'Postal Code', 'partner.zip', + {'partner': partner}, 16, gen_args=gen_args) + if partner.city: + town = etree.SubElement(postal_address, 'TwnNm') + town.text = self._prepare_field( + 'Town Name', 'partner.city', + {'partner': partner}, 35, gen_args=gen_args) + if partner.state_id: + country_subdiv = etree.SubElement( + postal_address, 'CtrySubDvsn') + country_subdiv.text = self._prepare_field( + 'Country SubDivision', 'partner.state_id.name', + {'partner': partner}, 35, gen_args=gen_args) + country = etree.SubElement(postal_address, 'Ctry') + country.text = self._prepare_field( + 'Country', 'partner.country_id.code', + {'partner': partner}, 2, gen_args=gen_args) + if partner.street: + adrline1 = etree.SubElement(postal_address, 'AdrLine') + adrline1.text = self._prepare_field( + 'Street', 'partner.street', + {'partner': partner}, 70, gen_args=gen_args) + if partner.street2: + adrline2 = etree.SubElement(postal_address, 'AdrLine') + adrline2.text = self._prepare_field( + 'Street2', 'partner.street2', + {'partner': partner}, 70, gen_args=gen_args) + + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + if partner_bank.acc_type == 'iban': + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = partner_bank.sanitized_acc_number + else: + party_account_other = etree.SubElement( + party_account_id, 'Othr') + party_account_other_id = etree.SubElement( + party_account_other, 'Id') + party_account_other_id.text = partner_bank.sanitized_acc_number + if order == 'B': + self.generate_party_agent( + parent_node, party_type, order, partner_bank, gen_args) + return True + + @api.model + def generate_remittance_info_block(self, parent_node, line, gen_args): + remittance_info_2_91 = etree.SubElement( + parent_node, 'RmtInf') + if line.communication_type == 'normal': + remittance_info_unstructured_2_99 = etree.SubElement( + remittance_info_2_91, 'Ustrd') + remittance_info_unstructured_2_99.text = \ + self._prepare_field( + 'Remittance Unstructured Information', + 'line.communication', {'line': line}, 140, + gen_args=gen_args) + else: + remittance_info_structured_2_100 = etree.SubElement( + remittance_info_2_91, 'Strd') + creditor_ref_information_2_120 = etree.SubElement( + remittance_info_structured_2_100, 'CdtrRefInf') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRefTp') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_2_121, 'Cd') + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_ref_info_type_issuer_2_125.text = \ + line.communication_type + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRef') + else: + if gen_args.get('structured_remittance_issuer', True): + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'Tp') + creditor_ref_info_type_or_2_122 = etree.SubElement( + creditor_ref_info_type_2_121, 'CdOrPrtry') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_or_2_122, 'Cd') + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_ref_info_type_issuer_2_125.text = \ + line.communication_type + + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'Ref') + + creditor_reference_2_126.text = \ + self._prepare_field( + 'Creditor Structured Reference', + 'line.communication', {'line': line}, 35, + gen_args=gen_args) + return True + + @api.model + def generate_creditor_scheme_identification( + self, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args): + csi_id = etree.SubElement(parent_node, 'Id') + csi_privateid = etree.SubElement(csi_id, 'PrvtId') + csi_other = etree.SubElement(csi_privateid, 'Othr') + csi_other_id = etree.SubElement(csi_other, 'Id') + csi_other_id.text = self._prepare_field( + identification_label, identification, eval_ctx, gen_args=gen_args) + csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') + csi_scheme_name_proprietary = etree.SubElement( + csi_scheme_name, 'Prtry') + csi_scheme_name_proprietary.text = scheme_name_proprietary + return True diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py deleted file mode 100644 index dcfa78208..000000000 --- a/account_banking_pain_base/models/banking_export_pain.py +++ /dev/null @@ -1,366 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2013-2016 Akretion - Alexis de Lattre -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openerp import models, api, _ -from openerp.exceptions import UserError -from openerp.tools.safe_eval import safe_eval -from datetime import datetime -from lxml import etree -from openerp import tools -import logging - - -try: - from unidecode import unidecode -except ImportError: - unidecode = None - -logger = logging.getLogger(__name__) - - -class AccountPaymentOrder(models.Model): - _inherit = 'account.payment.order' - - @api.model - def _prepare_field(self, field_name, field_value, eval_ctx, - max_size=0, gen_args=None): - """This function is designed to be inherited !""" - if gen_args is None: - gen_args = {} - assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' - try: - value = safe_eval(field_value, eval_ctx) - # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters - # But we are dealing with banks... - # and many banks don't want non-ASCCI characters ! - # cf section 1.4 "Character set" of the SEPA Credit Transfer - # Scheme Customer-to-bank guidelines - if gen_args.get('convert_to_ascii'): - value = unidecode(value) - unallowed_ascii_chars = [ - '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', - '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] - for unallowed_ascii_char in unallowed_ascii_chars: - value = value.replace(unallowed_ascii_char, '-') - except: - line = eval_ctx.get('line') - if line: - raise UserError( - _("Cannot compute the '%s' of the Payment Line with " - "reference '%s'.") - % (field_name, line.name)) - else: - raise UserError( - _("Cannot compute the '%s'.") % field_name) - if not isinstance(value, (str, unicode)): - raise UserError( - _("The type of the field '%s' is %s. It should be a string " - "or unicode.") - % (field_name, type(value))) - if not value: - raise UserError( - _("The '%s' is empty or 0. It should have a non-null value.") - % field_name) - if max_size and len(value) > max_size: - value = value[0:max_size] - return value - - @api.model - def _validate_xml(self, xml_string, gen_args): - xsd_etree_obj = etree.parse( - tools.file_open(gen_args['pain_xsd_file'])) - official_pain_schema = etree.XMLSchema(xsd_etree_obj) - - try: - root_to_validate = etree.fromstring(xml_string) - official_pain_schema.assertValid(root_to_validate) - except Exception, e: - logger.warning( - "The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) - logger.warning(e) - raise UserError( - _("The generated XML file is not valid against the official " - "XML Schema Definition. The generated XML file and the " - "full error have been written in the server logs. Here " - "is the error, which may give you an idea on the cause " - "of the problem : %s") - % unicode(e)) - return True - - @api.multi - def finalize_sepa_file_creation(self, xml_root, gen_args): - xml_string = etree.tostring( - xml_root, pretty_print=True, encoding='UTF-8', - xml_declaration=True) - logger.debug( - "Generated SEPA XML file in format %s below" - % gen_args['pain_flavor']) - logger.debug(xml_string) - self._validate_xml(xml_string, gen_args) - - filename = '%s%s.xml' % (gen_args['file_prefix'], self.name) - return (xml_string, filename) - - @api.model - def generate_group_header_block(self, parent_node, gen_args): - group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') - message_identification_1_1 = etree.SubElement( - group_header_1_0, 'MsgId') - message_identification_1_1.text = self._prepare_field( - 'Message Identification', - 'self.name', - {'self': self}, 35, gen_args=gen_args) - creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') - creation_date_time_1_2.text = datetime.strftime( - datetime.today(), '%Y-%m-%dT%H:%M:%S') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - # batch_booking is in "Group header" with pain.001.001.02 - # and in "Payment info" in pain.001.001.03/04 - batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') - batch_booking.text = unicode(self.batch_booking).lower() - nb_of_transactions_1_6 = etree.SubElement( - group_header_1_0, 'NbOfTxs') - control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') - # Grpg removed in pain.001.001.03 - if gen_args.get('pain_flavor') == 'pain.001.001.02': - grouping = etree.SubElement(group_header_1_0, 'Grpg') - grouping.text = 'GRPD' - self.generate_initiating_party_block(group_header_1_0, gen_args) - return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 - - @api.model - def generate_start_payment_info_block( - self, parent_node, payment_info_ident, - priority, local_instrument, sequence_type, requested_date, - eval_ctx, gen_args): - payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') - payment_info_identification_2_1 = etree.SubElement( - payment_info_2_0, 'PmtInfId') - payment_info_identification_2_1.text = self._prepare_field( - 'Payment Information Identification', - payment_info_ident, eval_ctx, 35, gen_args=gen_args) - payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') - payment_method_2_2.text = gen_args['payment_method'] - nb_of_transactions_2_4 = False - control_sum_2_5 = False - if gen_args.get('pain_flavor') != 'pain.001.001.02': - batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = unicode(self.batch_booking).lower() - # The "SEPA Customer-to-bank - # Implementation guidelines" for SCT and SDD says that control sum - # and nb_of_transactions should be present - # at both "group header" level and "payment info" level - nb_of_transactions_2_4 = etree.SubElement( - payment_info_2_0, 'NbOfTxs') - 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 and gen_args['payment_method'] != 'DD': - instruction_priority_2_7 = etree.SubElement( - payment_type_info_2_6, 'InstrPrty') - instruction_priority_2_7.text = priority - if self.sepa: - service_level_2_8 = etree.SubElement( - payment_type_info_2_6, 'SvcLvl') - service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') - service_level_code_2_9.text = 'SEPA' - if local_instrument: - local_instrument_2_11 = etree.SubElement( - payment_type_info_2_6, 'LclInstrm') - local_instr_code_2_12 = etree.SubElement( - local_instrument_2_11, 'Cd') - local_instr_code_2_12.text = local_instrument - if sequence_type: - sequence_type_2_14 = etree.SubElement( - payment_type_info_2_6, 'SeqTp') - sequence_type_2_14.text = sequence_type - - if gen_args['payment_method'] == 'DD': - request_date_tag = 'ReqdColltnDt' - else: - request_date_tag = 'ReqdExctnDt' - requested_date_2_17 = etree.SubElement( - payment_info_2_0, request_date_tag) - requested_date_2_17.text = requested_date - return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 - - @api.model - def _must_have_initiating_party(self, gen_args): - '''This method is designed to be inherited in localization modules for - countries in which the initiating party is required''' - return False - - @api.model - def generate_initiating_party_block(self, parent_node, gen_args): - my_company_name = self._prepare_field( - 'Company Name', - 'self.company_partner_bank_id.partner_id.name', - {'self': self}, gen_args.get('name_maxsize'), gen_args=gen_args) - initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') - initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') - initiating_party_name.text = my_company_name - initiating_party_identifier = ( - self.payment_mode_id.initiating_party_identifier or - self.payment_mode_id.company_id.initiating_party_identifier) - initiating_party_issuer = ( - self.payment_mode_id.initiating_party_issuer or - self.payment_mode_id.company_id.initiating_party_issuer) - if initiating_party_identifier and initiating_party_issuer: - iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') - iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') - iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') - iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') - iniparty_org_other_id.text = initiating_party_identifier - iniparty_org_other_issuer = etree.SubElement( - iniparty_org_other, 'Issr') - iniparty_org_other_issuer.text = initiating_party_issuer - elif self._must_have_initiating_party(gen_args): - raise UserError( - _("Missing 'Initiating Party Issuer' and/or " - "'Initiating Party Identifier' for the company '%s'. " - "Both fields must have a value.") - % self.company_id.name) - return True - - @api.model - def generate_party_agent( - self, parent_node, party_type, order, partner_bank, gen_args): - """Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD - Starting from Feb 1st 2016, we should be able to do - cross-border SEPA transfers without BIC, cf - http://www.europeanpaymentscouncil.eu/index.cfm/ - sepa-credit-transfer/iban-and-bic/""" - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - if partner_bank.bank_bic: - party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_bic = etree.SubElement( - party_agent_institution, gen_args.get('bic_xml_tag')) - party_agent_bic.text = partner_bank.bank_bic - else: - if order == 'B' or ( - order == 'C' and gen_args['payment_method'] == 'DD'): - party_agent = etree.SubElement( - parent_node, '%sAgt' % party_type) - party_agent_institution = etree.SubElement( - party_agent, 'FinInstnId') - party_agent_other = etree.SubElement( - party_agent_institution, 'Othr') - party_agent_other_identification = etree.SubElement( - party_agent_other, 'Id') - party_agent_other_identification.text = 'NOTPROVIDED' - # for Credit Transfers, in the 'C' block, if BIC is not provided, - # we should not put the 'Creditor Agent' block at all, - # as per the guidelines of the EPC - return True - - @api.model - def generate_party_block( - self, parent_node, party_type, order, partner_bank, gen_args): - """Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD""" - assert order in ('B', 'C'), "Order can be 'B' or 'C'" - if party_type == 'Cdtr': - party_type_label = 'Creditor' - elif party_type == 'Dbtr': - party_type_label = 'Debtor' - name = 'partner_bank.partner_id.name' - eval_ctx = {'partner_bank': partner_bank} - party_name = self._prepare_field( - '%s Name' % party_type_label, name, eval_ctx, - gen_args.get('name_maxsize'), gen_args=gen_args) - # At C level, the order is : BIC, Name, IBAN - # At B level, the order is : Name, IBAN, BIC - if order == 'C': - self.generate_party_agent( - parent_node, party_type, order, partner_bank, gen_args) - party = etree.SubElement(parent_node, party_type) - party_nm = etree.SubElement(party, 'Nm') - party_nm.text = party_name - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - if partner_bank.acc_type == 'iban': - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') - party_account_iban.text = partner_bank.sanitized_acc_number - else: - party_account_other = etree.SubElement( - party_account_id, 'Othr') - party_account_other_id = etree.SubElement( - party_account_other, 'Id') - party_account_other_id.text = partner_bank.sanitized_acc_number - if order == 'B': - self.generate_party_agent( - parent_node, party_type, order, partner_bank, gen_args) - return True - - @api.model - def generate_remittance_info_block(self, parent_node, line, gen_args): - remittance_info_2_91 = etree.SubElement( - parent_node, 'RmtInf') - if line.communication_type == 'normal': - remittance_info_unstructured_2_99 = etree.SubElement( - remittance_info_2_91, 'Ustrd') - remittance_info_unstructured_2_99.text = \ - self._prepare_field( - 'Remittance Unstructured Information', - 'line.communication', {'line': line}, 140, - gen_args=gen_args) - else: - remittance_info_structured_2_100 = etree.SubElement( - remittance_info_2_91, 'Strd') - creditor_ref_information_2_120 = etree.SubElement( - remittance_info_structured_2_100, 'CdtrRefInf') - if gen_args.get('pain_flavor') == 'pain.001.001.02': - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRefTp') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_2_121, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRef') - else: - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'Tp') - creditor_ref_info_type_or_2_122 = etree.SubElement( - creditor_ref_info_type_2_121, 'CdOrPrtry') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_or_2_122, 'Cd') - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'Ref') - - creditor_ref_info_type_code_2_123.text = 'SCOR' - creditor_ref_info_type_issuer_2_125.text = \ - line.communication_type - creditor_reference_2_126.text = \ - self._prepare_field( - 'Creditor Structured Reference', - 'line.communication', {'line': line}, 35, - gen_args=gen_args) - return True - - @api.model - def generate_creditor_scheme_identification( - self, parent_node, identification, identification_label, - eval_ctx, scheme_name_proprietary, gen_args): - csi_id = etree.SubElement(parent_node, 'Id') - csi_privateid = etree.SubElement(csi_id, 'PrvtId') - csi_other = etree.SubElement(csi_privateid, 'Othr') - csi_other_id = etree.SubElement(csi_other, 'Id') - csi_other_id.text = self._prepare_field( - identification_label, identification, eval_ctx, gen_args=gen_args) - csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') - csi_scheme_name_proprietary = etree.SubElement( - csi_scheme_name, 'Prtry') - csi_scheme_name_proprietary.text = scheme_name_proprietary - return True From 63946e09f36acdcf625739a3d12cb4433c2ecf34 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 3 Jun 2016 22:58:07 +0200 Subject: [PATCH 64/79] Adds flexibility to support direct debit direct debit for switzerland (pain.008.001.02.ch.01) Implement SEPA Core recommandations for postal address --- .../models/account_payment_order.py | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index d3611ba54..ae419320a 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -282,15 +282,18 @@ class AccountPaymentOrder(models.Model): initiating_party_issuer = ( self.payment_mode_id.initiating_party_issuer or self.payment_mode_id.company_id.initiating_party_issuer) - if initiating_party_identifier and initiating_party_issuer: + # in pain.008.001.02.ch.01.xsd files they use + # initiating_party_identifier but not initiating_party_issuer + if initiating_party_identifier: iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') iniparty_org_other_id.text = initiating_party_identifier - iniparty_org_other_issuer = etree.SubElement( - iniparty_org_other, 'Issr') - iniparty_org_other_issuer.text = initiating_party_issuer + if initiating_party_issuer: + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer elif self._must_have_initiating_party(gen_args): raise UserError( _("Missing 'Initiating Party Issuer' and/or " @@ -359,22 +362,6 @@ class AccountPaymentOrder(models.Model): partner = partner_bank.partner_id if partner.country_id: postal_address = etree.SubElement(party, 'PstlAdr') - if partner.zip: - post_code = etree.SubElement(postal_address, 'PstCd') - post_code.text = self._prepare_field( - 'Postal Code', 'partner.zip', - {'partner': partner}, 16, gen_args=gen_args) - if partner.city: - town = etree.SubElement(postal_address, 'TwnNm') - town.text = self._prepare_field( - 'Town Name', 'partner.city', - {'partner': partner}, 35, gen_args=gen_args) - if partner.state_id: - country_subdiv = etree.SubElement( - postal_address, 'CtrySubDvsn') - country_subdiv.text = self._prepare_field( - 'Country SubDivision', 'partner.state_id.name', - {'partner': partner}, 35, gen_args=gen_args) country = etree.SubElement(postal_address, 'Ctry') country.text = self._prepare_field( 'Country', 'partner.country_id.code', @@ -382,12 +369,12 @@ class AccountPaymentOrder(models.Model): if partner.street: adrline1 = etree.SubElement(postal_address, 'AdrLine') adrline1.text = self._prepare_field( - 'Street', 'partner.street', + 'Adress Line1', 'partner.street', {'partner': partner}, 70, gen_args=gen_args) - if partner.street2: + if partner.city and partner.zip: adrline2 = etree.SubElement(postal_address, 'AdrLine') adrline2.text = self._prepare_field( - 'Street2', 'partner.street2', + 'Address Line2', "partner.zip + ' ' + partner.city", {'partner': partner}, 70, gen_args=gen_args) party_account = etree.SubElement( From 872a34b8d5f261b1febb98c33d7efa7792340cbb Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 5 Jun 2016 00:44:27 +0200 Subject: [PATCH 65/79] Add field local_instrument in payment lines and bank payment lines --- account_banking_pain_base/models/account_payment_line.py | 4 ++++ account_banking_pain_base/models/bank_payment_line.py | 5 ++++- account_banking_pain_base/views/account_payment_line.xml | 1 + account_banking_pain_base/views/bank_payment_line_view.xml | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index 9ecf53d86..f599860e9 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -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 diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index 7885d701a..bf802ce6e 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -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 diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml index 6adab6916..640175857 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -14,6 +14,7 @@ + diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index 17d4e3049..672e4bbbe 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -14,6 +14,7 @@ + From 9720eb1079ebba059c506141add6052e9931d722 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 6 Jun 2016 14:05:43 +0200 Subject: [PATCH 66/79] Add the bank_line as argument to some methods that generate SEPA XML --- .../models/account_payment_order.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index ae419320a..afaab1993 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -304,13 +304,16 @@ class AccountPaymentOrder(models.Model): @api.model def generate_party_agent( - self, parent_node, party_type, order, partner_bank, gen_args): + self, parent_node, party_type, order, partner_bank, gen_args, + bank_line=None): """Generate the piece of the XML file corresponding to BIC This code is mutualized between TRF and DD Starting from Feb 1st 2016, we should be able to do cross-border SEPA transfers without BIC, cf http://www.europeanpaymentscouncil.eu/index.cfm/ - sepa-credit-transfer/iban-and-bic/""" + sepa-credit-transfer/iban-and-bic/ + In some localization (l10n_ch_sepa for example), they need the + bank_line argument""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" if partner_bank.bank_bic: party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) @@ -338,9 +341,12 @@ class AccountPaymentOrder(models.Model): @api.model def generate_party_block( - self, parent_node, party_type, order, partner_bank, gen_args): + self, parent_node, party_type, order, partner_bank, gen_args, + bank_line=None): """Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD""" + This code is mutualized between TRF and DD + In some localization (l10n_ch_sepa for example), they need the + bank_line argument""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" if party_type == 'Cdtr': party_type_label = 'Creditor' @@ -355,7 +361,8 @@ class AccountPaymentOrder(models.Model): # At B level, the order is : Name, IBAN, BIC if order == 'C': self.generate_party_agent( - parent_node, party_type, order, partner_bank, gen_args) + parent_node, party_type, order, partner_bank, gen_args, + bank_line=bank_line) party = etree.SubElement(parent_node, party_type) party_nm = etree.SubElement(party, 'Nm') party_nm.text = party_name @@ -392,7 +399,8 @@ class AccountPaymentOrder(models.Model): party_account_other_id.text = partner_bank.sanitized_acc_number if order == 'B': self.generate_party_agent( - parent_node, party_type, order, partner_bank, gen_args) + parent_node, party_type, order, partner_bank, gen_args, + bank_line=bank_line) return True @api.model From c9f5fe399281a8c25a1ccf1df6b0daff67691035 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 6 Jun 2016 14:36:51 +0200 Subject: [PATCH 67/79] Move the code that generate the bank account number in the SEPA XML file in a dedicated method --- .../models/account_payment_order.py | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index afaab1993..5b78ce466 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -339,6 +339,25 @@ class AccountPaymentOrder(models.Model): # as per the guidelines of the EPC return True + @api.model + def generate_party_bank_account( + self, parent_node, party_type, order, partner_bank, gen_args, + bank_line=None): + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + if partner_bank.acc_type == 'iban': + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = partner_bank.sanitized_acc_number + else: + party_account_other = etree.SubElement( + party_account_id, 'Othr') + party_account_other_id = etree.SubElement( + party_account_other, 'Id') + party_account_other_id.text = partner_bank.sanitized_acc_number + return True + @api.model def generate_party_block( self, parent_node, party_type, order, partner_bank, gen_args, @@ -384,19 +403,10 @@ class AccountPaymentOrder(models.Model): 'Address Line2', "partner.zip + ' ' + partner.city", {'partner': partner}, 70, gen_args=gen_args) - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - if partner_bank.acc_type == 'iban': - party_account_iban = etree.SubElement( - party_account_id, 'IBAN') - party_account_iban.text = partner_bank.sanitized_acc_number - else: - party_account_other = etree.SubElement( - party_account_id, 'Othr') - party_account_other_id = etree.SubElement( - party_account_other, 'Id') - party_account_other_id.text = partner_bank.sanitized_acc_number + self.generate_party_bank_account( + parent_node, party_type, order, partner_bank, gen_args, + bank_line=bank_line) + if order == 'B': self.generate_party_agent( parent_node, party_type, order, partner_bank, gen_args, From 33d247cb5755f3ba0faa1f77de7374e2773bc11b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 6 Jun 2016 15:57:36 +0200 Subject: [PATCH 68/79] Simpler variable names Rename method --- .../models/account_payment_order.py | 158 +++++++++--------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 5b78ce466..917df61dc 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -176,70 +176,69 @@ class AccountPaymentOrder(models.Model): @api.model def generate_group_header_block(self, parent_node, gen_args): - group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') - message_identification_1_1 = etree.SubElement( - group_header_1_0, 'MsgId') - message_identification_1_1.text = self._prepare_field( + group_header = etree.SubElement(parent_node, 'GrpHdr') + message_identification = etree.SubElement( + group_header, 'MsgId') + message_identification.text = self._prepare_field( 'Message Identification', 'self.name', {'self': self}, 35, gen_args=gen_args) - creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') - creation_date_time_1_2.text = datetime.strftime( + creation_date_time = etree.SubElement(group_header, 'CreDtTm') + creation_date_time.text = datetime.strftime( datetime.today(), '%Y-%m-%dT%H:%M:%S') if gen_args.get('pain_flavor') == 'pain.001.001.02': # batch_booking is in "Group header" with pain.001.001.02 # and in "Payment info" in pain.001.001.03/04 - batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking = etree.SubElement(group_header, 'BtchBookg') batch_booking.text = unicode(self.batch_booking).lower() - nb_of_transactions_1_6 = etree.SubElement( - group_header_1_0, 'NbOfTxs') - control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + nb_of_transactions = etree.SubElement( + group_header, 'NbOfTxs') + control_sum = etree.SubElement(group_header, 'CtrlSum') # Grpg removed in pain.001.001.03 if gen_args.get('pain_flavor') == 'pain.001.001.02': - grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping = etree.SubElement(group_header, 'Grpg') grouping.text = 'GRPD' - self.generate_initiating_party_block(group_header_1_0, gen_args) - return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + self.generate_initiating_party_block(group_header, gen_args) + return group_header, nb_of_transactions, control_sum @api.model def generate_start_payment_info_block( self, parent_node, payment_info_ident, priority, local_instrument, sequence_type, requested_date, eval_ctx, gen_args): - payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') - payment_info_identification_2_1 = etree.SubElement( - payment_info_2_0, 'PmtInfId') - payment_info_identification_2_1.text = self._prepare_field( + payment_info = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification = etree.SubElement( + payment_info, 'PmtInfId') + payment_info_identification.text = self._prepare_field( 'Payment Information Identification', payment_info_ident, eval_ctx, 35, gen_args=gen_args) - payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') - payment_method_2_2.text = gen_args['payment_method'] - nb_of_transactions_2_4 = False - control_sum_2_5 = False + payment_method = etree.SubElement(payment_info, 'PmtMtd') + payment_method.text = gen_args['payment_method'] + nb_of_transactions = False + control_sum = False if gen_args.get('pain_flavor') != 'pain.001.001.02': - batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') - batch_booking_2_3.text = unicode(self.batch_booking).lower() + batch_booking = etree.SubElement(payment_info, 'BtchBookg') + batch_booking.text = unicode(self.batch_booking).lower() # The "SEPA Customer-to-bank # Implementation guidelines" for SCT and SDD says that control sum # and nb_of_transactions should be present # at both "group header" level and "payment info" level - nb_of_transactions_2_4 = etree.SubElement( - payment_info_2_0, 'NbOfTxs') - control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum') - payment_type_info_2_6 = etree.SubElement( - payment_info_2_0, 'PmtTpInf') + nb_of_transactions = etree.SubElement( + payment_info, 'NbOfTxs') + control_sum = etree.SubElement(payment_info, 'CtrlSum') + payment_type_info = etree.SubElement( + payment_info, 'PmtTpInf') 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 + instruction_priority = etree.SubElement( + payment_type_info, 'InstrPrty') + instruction_priority.text = priority if self.sepa: - service_level_2_8 = etree.SubElement( - payment_type_info_2_6, 'SvcLvl') - service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') - service_level_code_2_9.text = 'SEPA' + service_level = etree.SubElement(payment_type_info, 'SvcLvl') + service_level_code = etree.SubElement(service_level, 'Cd') + service_level_code.text = 'SEPA' if local_instrument: local_instrument_root = etree.SubElement( - payment_type_info_2_6, 'LclInstrm') + payment_type_info, 'LclInstrm') if gen_args.get('local_instrument_type') == 'proprietary': local_instr_value = etree.SubElement( local_instrument_root, 'Prtry') @@ -248,18 +247,18 @@ class AccountPaymentOrder(models.Model): local_instrument_root, 'Cd') local_instr_value.text = local_instrument if sequence_type: - sequence_type_2_14 = etree.SubElement( - payment_type_info_2_6, 'SeqTp') - sequence_type_2_14.text = sequence_type + sequence_type_node = etree.SubElement( + payment_type_info, 'SeqTp') + sequence_type_node.text = sequence_type if gen_args['payment_method'] == 'DD': request_date_tag = 'ReqdColltnDt' else: request_date_tag = 'ReqdExctnDt' - requested_date_2_17 = etree.SubElement( - payment_info_2_0, request_date_tag) - requested_date_2_17.text = requested_date - return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + requested_date_node = etree.SubElement( + payment_info, request_date_tag) + requested_date_node.text = requested_date + return payment_info, nb_of_transactions, control_sum @api.model def _must_have_initiating_party(self, gen_args): @@ -273,8 +272,8 @@ class AccountPaymentOrder(models.Model): 'Company Name', 'self.company_partner_bank_id.partner_id.name', {'self': self}, gen_args.get('name_maxsize'), gen_args=gen_args) - initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') - initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party, 'Nm') initiating_party_name.text = my_company_name initiating_party_identifier = ( self.payment_mode_id.initiating_party_identifier or @@ -285,7 +284,7 @@ class AccountPaymentOrder(models.Model): # in pain.008.001.02.ch.01.xsd files they use # initiating_party_identifier but not initiating_party_issuer if initiating_party_identifier: - iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_id = etree.SubElement(initiating_party, 'Id') iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') @@ -340,7 +339,7 @@ class AccountPaymentOrder(models.Model): return True @api.model - def generate_party_bank_account( + def generate_party_acc_number( self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None): party_account = etree.SubElement( @@ -403,7 +402,7 @@ class AccountPaymentOrder(models.Model): 'Address Line2', "partner.zip + ' ' + partner.city", {'partner': partner}, 70, gen_args=gen_args) - self.generate_party_bank_account( + self.generate_party_acc_number( parent_node, party_type, order, partner_bank, gen_args, bank_line=bank_line) @@ -415,51 +414,52 @@ class AccountPaymentOrder(models.Model): @api.model def generate_remittance_info_block(self, parent_node, line, gen_args): - remittance_info_2_91 = etree.SubElement( + remittance_info = etree.SubElement( parent_node, 'RmtInf') if line.communication_type == 'normal': - remittance_info_unstructured_2_99 = etree.SubElement( - remittance_info_2_91, 'Ustrd') - remittance_info_unstructured_2_99.text = \ + remittance_info_unstructured = etree.SubElement( + remittance_info, 'Ustrd') + remittance_info_unstructured.text = \ self._prepare_field( 'Remittance Unstructured Information', 'line.communication', {'line': line}, 140, gen_args=gen_args) else: - remittance_info_structured_2_100 = etree.SubElement( - remittance_info_2_91, 'Strd') - creditor_ref_information_2_120 = etree.SubElement( - remittance_info_structured_2_100, 'CdtrRefInf') + remittance_info_structured = etree.SubElement( + remittance_info, 'Strd') + creditor_ref_information = etree.SubElement( + remittance_info_structured, 'CdtrRefInf') if gen_args.get('pain_flavor') == 'pain.001.001.02': - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRefTp') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_2_121, 'Cd') - creditor_ref_info_type_code_2_123.text = 'SCOR' - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_ref_info_type_issuer_2_125.text = \ + creditor_ref_info_type = etree.SubElement( + creditor_ref_information, 'CdtrRefTp') + creditor_ref_info_type_code = etree.SubElement( + creditor_ref_info_type, 'Cd') + creditor_ref_info_type_code.text = 'SCOR' + # SCOR means "Structured Communication Reference" + creditor_ref_info_type_issuer = etree.SubElement( + creditor_ref_info_type, 'Issr') + creditor_ref_info_type_issuer.text = \ line.communication_type - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'CdtrRef') + creditor_reference = etree.SubElement( + creditor_ref_information, 'CdtrRef') else: if gen_args.get('structured_remittance_issuer', True): - creditor_ref_info_type_2_121 = etree.SubElement( - creditor_ref_information_2_120, 'Tp') - creditor_ref_info_type_or_2_122 = etree.SubElement( - creditor_ref_info_type_2_121, 'CdOrPrtry') - creditor_ref_info_type_code_2_123 = etree.SubElement( - creditor_ref_info_type_or_2_122, 'Cd') - creditor_ref_info_type_code_2_123.text = 'SCOR' - creditor_ref_info_type_issuer_2_125 = etree.SubElement( - creditor_ref_info_type_2_121, 'Issr') - creditor_ref_info_type_issuer_2_125.text = \ + creditor_ref_info_type = etree.SubElement( + creditor_ref_information, 'Tp') + creditor_ref_info_type_or = etree.SubElement( + creditor_ref_info_type, 'CdOrPrtry') + creditor_ref_info_type_code = etree.SubElement( + creditor_ref_info_type_or, 'Cd') + creditor_ref_info_type_code.text = 'SCOR' + creditor_ref_info_type_issuer = etree.SubElement( + creditor_ref_info_type, 'Issr') + creditor_ref_info_type_issuer.text = \ line.communication_type - creditor_reference_2_126 = etree.SubElement( - creditor_ref_information_2_120, 'Ref') + creditor_reference = etree.SubElement( + creditor_ref_information, 'Ref') - creditor_reference_2_126.text = \ + creditor_reference.text = \ self._prepare_field( 'Creditor Structured Reference', 'line.communication', {'line': line}, 35, From 2ce69f8f83a403eab6a36035757ab61c5e6d16f0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 1 Jul 2016 21:01:13 +0200 Subject: [PATCH 69/79] [IMP] Remove unused POT files --- .../i18n/account_banking_pain_base.pot | 168 ------------------ 1 file changed, 168 deletions(-) delete mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot deleted file mode 100644 index ec6637431..000000000 --- a/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ /dev/null @@ -1,168 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-01 17:20+0000\n" -"PO-Revision-Date: 2015-06-01 17:20+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_partner_bank -msgid "Bank Accounts" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:85 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:52 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:78 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:94 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:129 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:313 -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:395 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:88 -#, python-format -msgid "Field type error:" -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "" - -#. module: account_banking_pain_base -#: field:banking.export.pain,id:0 -msgid "ID" -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_identifier:0 -msgid "Initiating Party Identifier" -msgstr "" - -#. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:396 -#, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "" - -#. module: account_banking_pain_base -#: view:res.company:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:95 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:314 -#, python-format -msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:130 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:52 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "" - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." -msgstr "" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_identifier:0 -msgid "This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo." -msgstr "" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." -msgstr "" - From 28d701cb97cbf218b13cd38c65f3838115ffc2c3 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 9 Apr 2016 02:15:34 -0400 Subject: [PATCH 70/79] OCA Transbot updated translations from Transifex --- account_banking_pain_base/i18n/en.po | 328 ++++++++++++++++++ account_banking_pain_base/i18n/es.po | 292 +++++++++++----- account_banking_pain_base/i18n/fr.po | 347 +++++++++++++------ account_banking_pain_base/i18n/nb_NO.po | 296 ++++++++++++++++ account_banking_pain_base/i18n/nl.po | 427 ++++++++++++++++-------- account_banking_pain_base/i18n/pt_BR.po | 297 ++++++++++++++++ account_banking_pain_base/i18n/sl.po | 315 +++++++++++++++++ 7 files changed, 1980 insertions(+), 322 deletions(-) create mode 100644 account_banking_pain_base/i18n/en.po create mode 100644 account_banking_pain_base/i18n/nb_NO.po create mode 100644 account_banking_pain_base/i18n/pt_BR.po create mode 100644 account_banking_pain_base/i18n/sl.po diff --git a/account_banking_pain_base/i18n/en.po b/account_banking_pain_base/i18n/en.po new file mode 100644 index 000000000..021c2c18f --- /dev/null +++ b/account_banking_pain_base/i18n/en.po @@ -0,0 +1,328 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-01 19:28+0000\n" +"PO-Revision-Date: 2016-07-01 19:28+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Bank Payment Lines" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "Batch Booking" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "Borne by Creditor" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "Borne by Debtor" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Cannot compute the '%s' of the Payment Line with reference '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Cannot compute the '%s'." + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "Charge Bearer" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Companies" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Convert to ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "Following Service Level" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "High" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "Initiating Party Identifier" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "Local Instrument" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "No XSD file path found for payment method '%s'" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "PAIN Version" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Payment Lines" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "Payment Methods" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "Payment Modes" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Payment Order" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Priority" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "SEPA Payment" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "Shared" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "The '%s' is empty or 0. It should have a non-null value." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "The type of the field '%s' is %s. It should be a string or unicode." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "pain.001.001.02" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "pain.001.001.03 (recommended for credit transfer)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "pain.001.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "pain.001.001.05" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "pain.001.003.03 (credit transfer in Germany)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "pain.008.001.02 (recommended for direct debit)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "pain.008.001.03" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "pain.008.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "pain.008.003.02 (direct debit in Germany)" diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po index c97064abc..48180672a 100644 --- a/account_banking_pain_base/i18n/es.po +++ b/account_banking_pain_base/i18n/es.po @@ -1,24 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_banking_pain_base -# +# * account_banking_pain_base +# +# Translators: +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-16 07:24+0000\n" -"PO-Revision-Date: 2016-02-16 07:24+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2016-07-01 19:28+0000\n" +"PO-Revision-Date: 2016-07-01 19:28+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_partner_bank -msgid "Bank Accounts" -msgstr "Cuentas de banco" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_bank_payment_line @@ -26,148 +24,284 @@ msgid "Bank Payment Lines" msgstr "Líneas de pago bancario" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:61 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:66 +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" +"No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 #, python-format msgid "Cannot compute the '%s'." msgstr "No se puede procesar el campo '%s'." +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_res_company msgid "Companies" msgstr "Compañías" #. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii msgid "Convert to ASCII" msgstr "Convertir a ASCII" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:280 -#, python-format -msgid "Error:" -msgstr "Error:" +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" #. module: account_banking_pain_base -#: selection:payment.line,priority:0 +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 msgid "High" msgstr "Alta" #. module: account_banking_pain_base -#: field:banking.export.pain,id:0 -msgid "ID" -msgstr "ID" +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" #. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." -msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado." +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" #. module: account_banking_pain_base -#: field:res.company,initiating_party_identifier:0 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "Identificador del iniciador de la transacción" #. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" msgstr "Emisor de la transacción" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:254 -#, python-format -msgid "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for the company '%s'. Both fields must have a value." -msgstr "Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la transacción' para la compañía '%s'. Ambos campos deben tener un valor." +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:356 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 #, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "Falta el campo 'Tipo de comunicación estructurada' en la línea de pago con referencia '%s'." +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" +"Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la " +"transacción' para la compañía '%s'. Ambos campos deben tener un valor." #. module: account_banking_pain_base -#: selection:payment.line,priority:0 +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 msgid "Normal" msgstr "Normal" #. module: account_banking_pain_base -#: view:res.company:account_banking_pain_base.view_company_form +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form msgid "Payment Initiation" msgstr "Iniciación del pago" #. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "Línea de pago" +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" #. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "Modo de pago" +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "" #. module: account_banking_pain_base -#: field:payment.line,priority:0 +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority msgid "Priority" msgstr "Prioridad" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:130 -#, python-format -msgid "SEPA File" -msgstr "Archivo SEPA" +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "" #. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "Tipo de comunicación estructurada" +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:281 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 #, python-format -msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation." -msgstr "La cuenta bancaria con IBAN '%s' de la empresa '%s' debe tener un BIC asociado, porque es una operación SEPA transfronteriza." +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"El archivo XML generado no se puede validar contra la definición de esquema " +"XML oficial. El archivo XML generado el error completo se ha escrito en los " +"registros del servidor. Aquí está el error, que le puede dar una idea de la " +"causa del problema : %s" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:95 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" -msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/banking_export_pain.py:34 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "Este IBAN no es válido: %s" +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" #. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." -msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado." +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" +"Esto se usará como el 'Identificador del iniciador de la transacción' en los" +" archivos PAIN generados por Odoo." #. module: account_banking_pain_base -#: help:res.company,initiating_party_identifier:0 -msgid "This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo." -msgstr "Esto se usará como el 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo." +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" #. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." -msgstr "Este campo se usará como 'Emisor de la transacción' en los archivos PAIN generados por Odoo." +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" +"Este campo se usará como 'Emisor de la transacción' en los archivos PAIN " +"generados por Odoo." +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index e58b8ece0..52d684034 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -1,80 +1,45 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_banking_pain_base -# +# * account_banking_pain_base +# +# Translators: +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2014-02-01 04:48+0000\n" -"Last-Translator: Alexis de Lattre \n" -"Language-Team: \n" +"POT-Creation-Date: 2016-07-01 19:28+0000\n" +"PO-Revision-Date: 2016-07-01 19:28+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" -"X-Generator: Launchpad (build 17031)\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 -msgid "Initiating Party Issuer" -msgstr "Initiating Party Issuer" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 -#, python-format -msgid "" -"The generated XML file is not valid against the official XML Schema " -"Definition. The generated XML file and the full error have been written in " -"the server logs. Here is the error, which may give you an idea on the cause " -"of the problem : %s" +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" msgstr "" -"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma " -"XML officiel. Le fichier XML généré et le message d'erreur complet ont été " -"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " -"une idée sur la cause du problème : %s" #. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "Priorité" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "Ligne de paiement" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "Mode de paiement" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by OpenERP." +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" msgstr "" -"Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés " -"par OpenERP." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "" -"Missing 'Structured Communication Type' on payment line with reference '%s'." +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" msgstr "" -"Le 'Type de communication structuré' n'est pas renseigné sur la ligne de " -"paiement ayant la référence '%s'." #. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "Normal" +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." msgstr "" @@ -82,28 +47,15 @@ msgstr "" "'%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 #, python-format msgid "Cannot compute the '%s'." msgstr "Impossible de calculer le '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" msgstr "" -"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "Erreur :" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_res_company @@ -111,62 +63,241 @@ msgid "Companies" msgstr "Sociétés" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Convertir en ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "Élevé" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 #, python-format -msgid "This IBAN is not valid : %s" -msgstr "Cet IBAN n'est pas valide : %s" +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 #, python-format -msgid "Field type error:" -msgstr "Erreur dans le type de champ :" +msgid "No XSD file path found for payment method '%s'" +msgstr "" #. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "Type de communication structurée" +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normal" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Priorité" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." #. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "banking.export.pain" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#, python-format msgid "" -"If active, OpenERP will convert each accented caracter to the corresponding " -"unaccented caracter, so that only ASCII caracters are used in the generated " -"PAIN file." +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" msgstr "" -"Si actif, OpenERP convertira chaque caractère accentué en son équivalent non " -"accentué, de telle façon que seuls des caractères ASCII soient utilisés dans " -"le fichier PAIN généré." +"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma" +" XML officiel. Le fichier XML généré et le message d'erreur complet ont été " +"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " +"une idée sur la cause du problème : %s" #. module: account_banking_pain_base -#: help:payment.line,priority:0 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" +"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority msgid "" -"This field will be used as the 'Instruction Priority' in the generated PAIN " +"This field will be used as 'Instruction Priority' in the generated PAIN " "file." -msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." +msgstr "" #. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "Payment Initiation" +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" #. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "Élevé" +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" #. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "Convertir en ASCII" +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" diff --git a/account_banking_pain_base/i18n/nb_NO.po b/account_banking_pain_base/i18n/nb_NO.po new file mode 100644 index 000000000..3d3eef43a --- /dev/null +++ b/account_banking_pain_base/i18n/nb_NO.po @@ -0,0 +1,296 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# Imre Kristoffer Eilertsen , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-30 07:37+0000\n" +"PO-Revision-Date: 2016-07-30 07:37+0000\n" +"Last-Translator: Imre Kristoffer Eilertsen , 2016\n" +"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/teams/23907/nb_NO/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nb_NO\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Betalingsordre" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po index 721d24f68..5366496ad 100644 --- a/account_banking_pain_base/i18n/nl.po +++ b/account_banking_pain_base/i18n/nl.po @@ -1,29 +1,214 @@ -# Dutch translation for banking-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the banking-addons package. -# FIRST AUTHOR , 2014. -# +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# Erwin van der Ploeg , 2016 msgid "" msgstr "" -"Project-Id-Version: banking-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2014-02-11 08:32+0000\n" -"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" -"Language-Team: Dutch \n" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-22 23:52+0000\n" +"PO-Revision-Date: 2016-07-22 23:52+0000\n" +"Last-Translator: Erwin van der Ploeg , 2016\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" -"X-Generator: Launchpad (build 17031)\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_banking_pain_base -#: field:res.company,initiating_party_issuer:0 +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Bank betaalregels" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "Batch verwerking" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "Ten laste van de Crediteur" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "Ten laste van de Debiteur" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Kan de '%s' niet berekenen." + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "Kostendrager" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Converteer naar ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "Volgens Service Level" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" +"Volgens Service Level: transactiekosten worden toegepast volgens de regels " +"vastgelegd in het service level en/of schema (SEPA Core berichten gebruiken " +"dit). Gedeeld: transactiekosten aan de debiteurzijde komen ten laste van de " +"debiteur, transactiekosten aan crediteurszijde komen ten laste van de " +"crediteur. Ten laste van de crediteur: alle transactiekosten komen ten laste" +" van de crediteur. Ten laste van de Debiteur: alle transactiekosten komen " +"ten laste van de debiteur. " + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "Hoog" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" +"Wanneer actief, zal Odoo geaccentueerde karakters omzetten naar het " +"corresponderende niet geaccentueerde karakter, dit zodat alleen ASCII " +"gebruikt wordt in de gegenereerde PAIN file. " + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" +"Wanneer waar, zal het bankafschrift één debit lijn bevatten voor alle " +"overschrijvingen in het SEPA bestand; wanneer onwaar, zal het bankafschrift " +"een debit lijn per overschrijving bevatten in het SEPA bestand. " + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "Initiating Party Identifier" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" msgstr "Initiating Party Issuer" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "Lokaal Instrument" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" +"Missende 'Initiating Party Issuer' en/of 'Initiating Party Identifier' voor " +"het bedrijf '%s'. Beide velden moet een waarde bevatten." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "Geen XSD bestandlocatie gevonden voor betaalmethode '%s'." + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normaal" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "PAIN Versie" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Betaalregels" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "Betaalwijzes" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "Betaalmode" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Betalingsopdracht" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Prioriteit" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "SEPA betaling" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "Gedeeld" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " @@ -37,136 +222,108 @@ msgstr "" "kunt geven over de oorzaak van het probleem: %s\"" #. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" -msgstr "Prioriteit" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_line -msgid "Payment Line" -msgstr "Betaalregel" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_payment_mode -msgid "Payment Mode" -msgstr "Betaalwijze" - -#. module: account_banking_pain_base -#: help:res.company,initiating_party_issuer:0 -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by OpenERP." -msgstr "" -"Dit wordt gebruikt als de 'Initiating Party Issuer' in de PAIN bestanden " -"gegenereerd door OpenERP." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "" -"Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" -"Ontbrekende 'Structured Communication Type' op betaalregel met referentie " -"'%s'." - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "Normaal" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "Kan de '%s' niet berekenen." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "Fout:" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "Bedrijven" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "Deze IBAN is niet geldig : %s" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" -msgstr "Veld type fout:" - -#. module: account_banking_pain_base -#: field:payment.line,struct_communication_type:0 -msgid "Structured Communication Type" -msgstr "Structured Communication Type" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" -msgstr "banking.export.pain" - -#. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority msgid "" -"If active, OpenERP will convert each accented caracter to the corresponding " -"unaccented caracter, so that only ASCII caracters are used in the generated " -"PAIN file." -msgstr "" -"Indien aangevinkt, zal OpenERP elk geaccentueerde karakter omzetten in een " -"overeenkomstige ongeaccentueerde karakter, zodat alleen ASCII karakters " -"worden gebruikt in het gegenereerde PAIN bestand." - -#. module: account_banking_pain_base -#: help:payment.line,priority:0 -msgid "" -"This field will be used as the 'Instruction Priority' in the generated PAIN " +"This field will be used as 'Instruction Priority' in the generated PAIN " "file." msgstr "" -"Dit veld wordt gebruikt als de 'Instruction Priority' in het gegenereerde " -"PAIN bestand." +"Dit veld wordt gebruikt als 'Instructie Prioriteit' in het gegeneerde PAIN " +"bestand." #. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "Payment Initiation" +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" +"Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN " +"bestanden." #. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "Hoog" +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN " +"bestanden. Wanneer niet ingesteld wordt de Initiating Party Identifier uit " +"de bedrijfsinstellingen gebruikt." #. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" -msgstr "Converteer naar ASCII" +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" +"Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN " +"bestanden." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN bestanden. Wanneer niet ingesteld wordt de Initiating Party Issuer uit de bedrijfsinstellingen gebruikt.\n" +"Standaard formaat(13):\n" +"- Land Code (2, optioneel)\n" +"- Bedrijfsidentificatie (N, BTWnr)\n" +"- Service achtervoegsel (N, uitgegeven door de bank)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "pain.001.001.02" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "pain.001.001.03 (aanbevolne voor overboekingen)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "pain.001.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "pain.001.001.05" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "pain.001.003.03 (overboekingen in Duitsland)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "pain.008.001.02 (aanbevolen voor incasso)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "pain.008.001.03" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "pain.008.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "pain.008.003.02 (Incasso in Duitsland)" diff --git a/account_banking_pain_base/i18n/pt_BR.po b/account_banking_pain_base/i18n/pt_BR.po new file mode 100644 index 000000000..effa436b0 --- /dev/null +++ b/account_banking_pain_base/i18n/pt_BR.po @@ -0,0 +1,297 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-01 19:28+0000\n" +"PO-Revision-Date: 2016-07-01 19:28+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Linhas de pagamento bancária" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" +"Não foi possível calcular a '%s' da linha de pagamento com referência '%s'" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Não foi possível computar o '%s'" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Empresas" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Converter para ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "Alto" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" diff --git a/account_banking_pain_base/i18n/sl.po b/account_banking_pain_base/i18n/sl.po new file mode 100644 index 000000000..109ad0388 --- /dev/null +++ b/account_banking_pain_base/i18n/sl.po @@ -0,0 +1,315 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-01 19:28+0000\n" +"PO-Revision-Date: 2016-07-01 19:28+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Postavke bančnih plačil" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Ne morem izračunati '%s' plačilne postavke s sklicem '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Ne morem izračunati '%s'." + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Družbe" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Pretvori v ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "Visoka" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "Identifikator začetne stranke" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "Izdajatelj začetne stranke" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" +"Manjkajoči 'Izdajatelj začetne stranke' in/ali 'Identifikator začetne " +"stranke' pri družbi '%s'. Obe polji morata vsebovati vrednost." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Običajna" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Začetek plačil" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Prioriteta" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "'%s' je prazno ali 0. Vsebovati bi moralo ne ničelno vrednost." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Ustvarjena XML datoteka ni v skladu z uradno definicijo XML sheme. " +"Ustvarjena XML datoteka in celotna napaka sta zapisani v strežniške " +"dnevnike. Tu je napaka, ki bi lahko razjasnila, v čem je vzrok težave : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "Tip polja '%s' je %s. Moral bi biti niz ali unicode." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" +"To se uporabi kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih " +"ustvari Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"To bo uporabljeno kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\n" +"Običajni format (13): \n" +"- Koda države (2, optional)\n" +"- Identifikator družbe (ID za DDV)\n" +"- Pripona storitve (številka, ki jo poda banka)" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" +"To se uporabi kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih " +"ustvari Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" +"To bo uporabljeno kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\n" +"Običajni format (13): \n" +"- Koda države (2, optional)\n" +"- Identifikator družbe (ID za DDV)\n" +"- Pripona storitve (številka, ki jo poda banka)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" From b7875596dbbf402524b60cc8106054fe6ba131e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 15 Aug 2016 18:54:38 +0200 Subject: [PATCH 71/79] [FIX] remove en.po that was erroneously created by transbot --- account_banking_pain_base/i18n/en.po | 328 --------------------------- 1 file changed, 328 deletions(-) delete mode 100644 account_banking_pain_base/i18n/en.po diff --git a/account_banking_pain_base/i18n/en.po b/account_banking_pain_base/i18n/en.po deleted file mode 100644 index 021c2c18f..000000000 --- a/account_banking_pain_base/i18n/en.po +++ /dev/null @@ -1,328 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 19:28+0000\n" -"PO-Revision-Date: 2016-07-01 19:28+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "Bank Payment Lines" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking -msgid "Batch Booking" -msgstr "Batch Booking" - -#. module: account_banking_pain_base -#: selection:account.payment.order,charge_bearer:0 -msgid "Borne by Creditor" -msgstr "Borne by Creditor" - -#. module: account_banking_pain_base -#: selection:account.payment.order,charge_bearer:0 -msgid "Borne by Debtor" -msgstr "Borne by Debtor" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "Cannot compute the '%s' of the Payment Line with reference '%s'." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "Cannot compute the '%s'." - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer -msgid "Charge Bearer" -msgstr "Charge Bearer" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "Companies" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii -msgid "Convert to ASCII" -msgstr "Convert to ASCII" - -#. module: account_banking_pain_base -#: selection:account.payment.order,charge_bearer:0 -msgid "Following Service Level" -msgstr "Following Service Level" - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer -msgid "" -"Following service level : transaction charges are to be applied following " -"the rules agreed in the service level and/or scheme (SEPA Core messages must" -" use this). Shared : transaction charges on the debtor side are to be borne " -"by the debtor, transaction charges on the creditor side are to be borne by " -"the creditor. Borne by creditor : all transaction charges are to be borne by" -" the creditor. Borne by debtor : all transaction charges are to be borne by " -"the debtor." -msgstr "" -"Following service level : transaction charges are to be applied following " -"the rules agreed in the service level and/or scheme (SEPA Core messages must" -" use this). Shared : transaction charges on the debtor side are to be borne " -"by the debtor, transaction charges on the creditor side are to be borne by " -"the creditor. Borne by creditor : all transaction charges are to be borne by" -" the creditor. Borne by debtor : all transaction charges are to be borne by " -"the debtor." - -#. module: account_banking_pain_base -#: selection:account.payment.line,priority:0 -msgid "High" -msgstr "High" - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii -msgid "" -"If active, Odoo will convert each accented character to the corresponding " -"unaccented character, so that only ASCII characters are used in the " -"generated PAIN file." -msgstr "" -"If active, Odoo will convert each accented character to the corresponding " -"unaccented character, so that only ASCII characters are used in the " -"generated PAIN file." - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking -msgid "" -"If true, the bank statement will display only one debit line for all the " -"wire transfers of the SEPA XML file ; if false, the bank statement will " -"display one debit line per wire transfer of the SEPA XML file." -msgstr "" -"If true, the bank statement will display only one debit line for all the " -"wire transfers of the SEPA XML file ; if false, the bank statement will " -"display one debit line per wire transfer of the SEPA XML file." - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier -#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier -msgid "Initiating Party Identifier" -msgstr "Initiating Party Identifier" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer -#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer -msgid "Initiating Party Issuer" -msgstr "Initiating Party Issuer" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument -#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument -msgid "Local Instrument" -msgstr "Local Instrument" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 -#, python-format -msgid "" -"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " -"the company '%s'. Both fields must have a value." -msgstr "" -"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " -"the company '%s'. Both fields must have a value." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 -#, python-format -msgid "No XSD file path found for payment method '%s'" -msgstr "No XSD file path found for payment method '%s'" - -#. module: account_banking_pain_base -#: selection:account.payment.line,priority:0 -msgid "Normal" -msgstr "Normal" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version -msgid "PAIN Version" -msgstr "PAIN Version" - -#. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "Payment Initiation" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_account_payment_line -msgid "Payment Lines" -msgstr "Payment Lines" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_account_payment_method -msgid "Payment Methods" -msgstr "Payment Methods" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode -msgid "Payment Modes" -msgstr "Payment Modes" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_account_payment_order -msgid "Payment Order" -msgstr "Payment Order" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority -#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority -msgid "Priority" -msgstr "Priority" - -#. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa -msgid "SEPA Payment" -msgstr "SEPA Payment" - -#. module: account_banking_pain_base -#: selection:account.payment.order,charge_bearer:0 -msgid "Shared" -msgstr "Shared" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 -#, python-format -msgid "The '%s' is empty or 0. It should have a non-null value." -msgstr "The '%s' is empty or 0. It should have a non-null value." - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 -#, python-format -msgid "" -"The generated XML file is not valid against the official XML Schema " -"Definition. The generated XML file and the full error have been written in " -"the server logs. Here is the error, which may give you an idea on the cause " -"of the problem : %s" -msgstr "" -"The generated XML file is not valid against the official XML Schema " -"Definition. The generated XML file and the full error have been written in " -"the server logs. Here is the error, which may give you an idea on the cause " -"of the problem : %s" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "The type of the field '%s' is %s. It should be a string or unicode." - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority -#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority -msgid "" -"This field will be used as 'Instruction Priority' in the generated PAIN " -"file." -msgstr "" -"This field will be used as 'Instruction Priority' in the generated PAIN " -"file." - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier -msgid "" -"This will be used as the 'Initiating Party Identifier' in the PAIN files " -"generated by Odoo." -msgstr "" -"This will be used as the 'Initiating Party Identifier' in the PAIN files " -"generated by Odoo." - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier -msgid "" -"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" -"Common format (13): \n" -"- Country code (2, optional)\n" -"- Company idenfier (N, VAT)\n" -"- Service suffix (N, issued by bank)" -msgstr "" -"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" -"Common format (13): \n" -"- Country code (2, optional)\n" -"- Company idenfier (N, VAT)\n" -"- Service suffix (N, issued by bank)" - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by Odoo." -msgstr "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files " -"generated by Odoo." - -#. module: account_banking_pain_base -#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer -msgid "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" -"Common format (13): \n" -"- Country code (2, optional)\n" -"- Company idenfier (N, VAT)\n" -"- Service suffix (N, issued by bank)" -msgstr "" -"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" -"Common format (13): \n" -"- Country code (2, optional)\n" -"- Company idenfier (N, VAT)\n" -"- Service suffix (N, issued by bank)" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.001.001.02" -msgstr "pain.001.001.02" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.001.001.03 (recommended for credit transfer)" -msgstr "pain.001.001.03 (recommended for credit transfer)" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.001.001.04" -msgstr "pain.001.001.04" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.001.001.05" -msgstr "pain.001.001.05" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.001.003.03 (credit transfer in Germany)" -msgstr "pain.001.003.03 (credit transfer in Germany)" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.008.001.02 (recommended for direct debit)" -msgstr "pain.008.001.02 (recommended for direct debit)" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.008.001.03" -msgstr "pain.008.001.03" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.008.001.04" -msgstr "pain.008.001.04" - -#. module: account_banking_pain_base -#: selection:account.payment.method,pain_version:0 -msgid "pain.008.003.02 (direct debit in Germany)" -msgstr "pain.008.003.02 (direct debit in Germany)" From 4ed1e4d4f7e577e722c9828a9ce43c82b00eaaf3 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:47:39 +0200 Subject: [PATCH 72/79] [MIG] Make modules uninstallable --- account_banking_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py index 809182e29..e03f149d1 100644 --- a/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -30,5 +30,5 @@ 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'installable': True, + 'installable': False, } From 8aadcd51dc0934cd8a316dac7915f2645052cc60 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:47:44 +0200 Subject: [PATCH 73/79] [MIG] Rename manifest files --- account_banking_pain_base/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename account_banking_pain_base/{__openerp__.py => __manifest__.py} (100%) diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__manifest__.py similarity index 100% rename from account_banking_pain_base/__openerp__.py rename to account_banking_pain_base/__manifest__.py From 59724e429cebea08212b441a7233848cfda628c8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 20 Oct 2016 01:41:41 +0200 Subject: [PATCH 74/79] Port almost all modules to v10 (#305) Port almost all modules to v10 * Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug #300) --- account_banking_pain_base/__manifest__.py | 8 ++--- .../migrations/8.0.0.2/post-migration.py | 15 --------- account_banking_pain_base/models/__init__.py | 3 +- .../models/account_config_settings.py | 14 +++++++++ .../models/account_payment_line.py | 2 +- .../models/account_payment_method.py | 4 +-- .../models/account_payment_mode.py | 2 +- .../models/account_payment_order.py | 7 ++--- .../models/bank_payment_line.py | 4 +-- .../models/res_company.py | 31 +++++++++---------- account_banking_pain_base/post_install.py | 13 ++++---- .../views/account_config_settings.xml | 24 ++++++++++++++ .../views/account_payment_line.xml | 13 ++++---- .../views/account_payment_method.xml | 6 ++-- .../views/account_payment_mode.xml | 11 +++---- .../views/account_payment_order.xml | 13 ++++---- .../views/bank_payment_line_view.xml | 13 ++++---- .../views/res_company_view.xml | 25 --------------- 18 files changed, 97 insertions(+), 111 deletions(-) delete mode 100644 account_banking_pain_base/migrations/8.0.0.2/post-migration.py create mode 100644 account_banking_pain_base/models/account_config_settings.py create mode 100644 account_banking_pain_base/views/account_config_settings.xml delete mode 100644 account_banking_pain_base/views/res_company_view.xml diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index e03f149d1..6643f992e 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -7,11 +7,11 @@ { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Tecnativa, " "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', @@ -26,9 +26,9 @@ 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', 'views/account_payment_mode.xml', - 'views/res_company_view.xml', + 'views/account_config_settings.xml', 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', - 'installable': False, + 'installable': True, } diff --git a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py b/account_banking_pain_base/migrations/8.0.0.2/post-migration.py deleted file mode 100644 index 1a2815795..000000000 --- a/account_banking_pain_base/migrations/8.0.0.2/post-migration.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2015 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openerp.addons.account_banking_pain_base.post_install\ - import set_default_initiating_party -from openerp import pooler - - -def migrate(cr, version): - if not version: - return - - pool = pooler.get_pool(cr.dbname) - set_default_initiating_party(cr, pool) diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 1e4dfae26..828efee19 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- -# © 2013-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import account_payment_line from . import account_payment_order from . import bank_payment_line from . import account_payment_mode from . import res_company +from . import account_config_settings from . import account_payment_method diff --git a/account_banking_pain_base/models/account_config_settings.py b/account_banking_pain_base/models/account_config_settings.py new file mode 100644 index 000000000..0a7caba0f --- /dev/null +++ b/account_banking_pain_base/models/account_config_settings.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class AccountConfigSettings(models.TransientModel): + _inherit = 'account.config.settings' + + initiating_party_issuer = fields.Char( + related='company_id.initiating_party_issuer') + initiating_party_identifier = fields.Char( + related='company_id.initiating_party_identifier') diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index f599860e9..c430b5cff 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -3,7 +3,7 @@ # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountPaymentLine(models.Model): diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 9d9499036..f7623a5d6 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -2,8 +2,8 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class AccountPaymentMethod(models.Model): diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index e0e628a59..95ff0be79 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -4,7 +4,7 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import models, fields class AccountPaymentMode(models.Model): diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 917df61dc..4e62f6a99 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -4,12 +4,11 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api, _ -from openerp.exceptions import UserError -from openerp.tools.safe_eval import safe_eval +from odoo import models, fields, api, _, tools +from odoo.exceptions import UserError +from odoo.tools.safe_eval import safe_eval from datetime import datetime from lxml import etree -from openerp import tools import logging diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index bf802ce6e..dde080637 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api class BankPaymentLine(models.Model): diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index aed1c1ca1..82e9d2711 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2013-2015 Akretion - Alexis de Lattre +# © 2013-2016 Akretion - Alexis de Lattre # © 2013 Noviat (http://www.noviat.com) - Luc de Meyer # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from odoo import models, fields, api import logging logger = logging.getLogger(__name__) @@ -22,32 +22,31 @@ class ResCompany(models.Model): help="This will be used as the 'Initiating Party Identifier' in " "the PAIN files generated by Odoo.") - @api.model - def _default_initiating_party(self, company): - '''This method is called from post_install.py, which itself is also - called from migrations/8.0.0.2/post-migration.py''' + @api.one + def _default_initiating_party(self): + '''This method is called from post_install.py''' party_issuer_per_country = { 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium } logger.debug( - 'Calling _default_initiating_party on company %s', company.name) - country_code = company.country_id.code - if not company.initiating_party_issuer: + 'Calling _default_initiating_party on company %s', self.name) + country_code = self.country_id.code + if not self.initiating_party_issuer: if country_code and country_code in party_issuer_per_country: - company.write({ + self.write({ 'initiating_party_issuer': party_issuer_per_country[country_code]}) logger.info( 'Updated initiating_party_issuer on company %s', - company.name) + self.name) party_identifier = False - if not company.initiating_party_identifier: - if company.vat and country_code: + if not self.initiating_party_identifier: + if self.vat and country_code: if country_code == 'BE': - party_identifier = company.vat[2:].replace(' ', '') + party_identifier = self.vat[2:].replace(' ', '') if party_identifier: - company.write({ + self.write({ 'initiating_party_identifier': party_identifier}) logger.info( 'Updated initiating_party_identifier on company %s', - company.name) + self.name) diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index 14a9259f9..df73e14d7 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -3,13 +3,12 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID -def set_default_initiating_party(cr, pool): - company_ids = pool['res.company'].search(cr, SUPERUSER_ID, []) - companies = pool['res.company'].browse(cr, SUPERUSER_ID, company_ids) - for company in companies: - pool['res.company']._default_initiating_party( - cr, SUPERUSER_ID, company) +def set_default_initiating_party(cr, registry): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + companies = env['res.company'].search([]) + companies._default_initiating_party() return diff --git a/account_banking_pain_base/views/account_config_settings.xml b/account_banking_pain_base/views/account_config_settings.xml new file mode 100644 index 000000000..059b3e02e --- /dev/null +++ b/account_banking_pain_base/views/account_config_settings.xml @@ -0,0 +1,24 @@ + + + + + + + pain.group.on.account.config.settings + account.config.settings + + + + + + + + + + + + + diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml index 640175857..e84958e63 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -1,11 +1,10 @@ - - + + pain.base.account.payment.line @@ -19,5 +18,5 @@ - - + + diff --git a/account_banking_pain_base/views/account_payment_method.xml b/account_banking_pain_base/views/account_payment_method.xml index 8d223b2b0..00685f7d6 100644 --- a/account_banking_pain_base/views/account_payment_method.xml +++ b/account_banking_pain_base/views/account_payment_method.xml @@ -1,6 +1,5 @@ - - + @@ -28,5 +27,4 @@ - - + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index 29546b84e..5cb2b4d02 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -1,12 +1,10 @@ - - + @@ -23,5 +21,4 @@ - - + diff --git a/account_banking_pain_base/views/account_payment_order.xml b/account_banking_pain_base/views/account_payment_order.xml index e99928637..6c1e02900 100644 --- a/account_banking_pain_base/views/account_payment_order.xml +++ b/account_banking_pain_base/views/account_payment_order.xml @@ -1,11 +1,10 @@ - - + + pain.base.account.payment.order.form @@ -20,5 +19,5 @@ - - + + diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index 672e4bbbe..f9496dffd 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -1,11 +1,10 @@ - - + + pain.base.bank.payment.line.form @@ -19,5 +18,5 @@ - - + + diff --git a/account_banking_pain_base/views/res_company_view.xml b/account_banking_pain_base/views/res_company_view.xml deleted file mode 100644 index fd3af4755..000000000 --- a/account_banking_pain_base/views/res_company_view.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - pain.group.on.res.company.form - res.company - - - - - - - - - - - - - From c803927b465bed756099f2e3026243bd0e205055 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sun, 2 Apr 2017 04:04:55 +0200 Subject: [PATCH 75/79] [CHG] *: Change copyright and author after company merging --- account_banking_pain_base/__manifest__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index 6643f992e..173527f99 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa +# © 2014 Tecnativa - Pedro M. Baeza +# © 2016 Tecnativa - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { @@ -12,7 +12,6 @@ 'author': "Akretion, " "Noviat, " "Tecnativa, " - "Antiun Ingeniería S.L., " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', 'contributors': ['Pedro M. Baeza '], From f787626993072896bb41d740e36bf29046de320d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 29 May 2017 18:07:40 +0200 Subject: [PATCH 76/79] Add support for ISO20022 "Category Purpose" Add local instrument 'INST' for SEPA Instant Credit Transfer --- .../models/account_payment_line.py | 43 +++++++++++++++++-- .../models/account_payment_order.py | 11 +++-- .../models/bank_payment_line.py | 4 +- .../views/account_payment_line.xml | 3 +- .../views/bank_payment_line_view.xml | 3 +- 5 files changed, 55 insertions(+), 9 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index c430b5cff..a460b9551 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -15,10 +15,47 @@ 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 is used for instant credit transfers which + # will begin on November 2017, cf account_banking_sepa_credit_transfer + # It is also used in some countries such as switzerland, + # cf l10n_ch_pain_base that adds some entries in the selection field local_instrument = fields.Selection([], string='Local Instrument') + category_purpose = fields.Selection([ + # Full category purpose list found on: + # https://www.iso20022.org/external_code_list.page + # Document "External Code Sets spreadsheet" version Feb 8th 2017 + ('BONU', 'Bonus Payment'), + ('CASH', 'Cash Management Transfer'), + ('CBLK', 'Card Bulk Clearing'), + ('CCRD', 'Credit Card Payment'), + ('CORT', 'Trade Settlement Payment'), + ('DCRD', 'Debit Card Payment'), + ('DIVI', 'Dividend'), + ('DVPM', 'Deliver Against Payment'), + ('EPAY', 'ePayment'), + ('FCOL', 'Fee Collection'), + ('GOVT', 'Government Payment'), + ('HEDG', 'Hedging'), + ('ICCP', 'Irrevocable Credit Card Payment'), + ('IDCP', 'Irrevocable Debit Card Payment'), + ('INTC', 'Intra-Company Payment'), + ('INTE', 'Interest'), + ('LOAN', 'Loan'), + ('OTHR', 'Other Payment'), + ('PENS', 'Pension Payment'), + ('RVPM', 'Receive Against Payment'), + ('SALA', 'Salary Payment'), + ('SECU', 'Securities'), + ('SSBE', 'Social Security Benefit'), + ('SUPP', 'Supplier Payment'), + ('TAXS', 'Tax Payment'), + ('TRAD', 'Trade'), + ('TREA', 'Treasury Payment'), + ('VATX', 'VAT Payment'), + ('WHLD', 'WithHolding'), + ], string="Category Purpose", + help="If neither your bank nor your local regulations oblige you to " + "set the category purpose, leave the field empty.") # PAIN allows 140 characters communication = fields.Char(size=140) # The field struct_communication_type has been dropped in v9 diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 4e62f6a99..751096e22 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -203,8 +203,8 @@ class AccountPaymentOrder(models.Model): @api.model def generate_start_payment_info_block( self, parent_node, payment_info_ident, - priority, local_instrument, sequence_type, requested_date, - eval_ctx, gen_args): + priority, local_instrument, category_purpose, sequence_type, + requested_date, eval_ctx, gen_args): payment_info = etree.SubElement(parent_node, 'PmtInf') payment_info_identification = etree.SubElement( payment_info, 'PmtInfId') @@ -249,7 +249,12 @@ class AccountPaymentOrder(models.Model): sequence_type_node = etree.SubElement( payment_type_info, 'SeqTp') sequence_type_node.text = sequence_type - + if category_purpose: + category_purpose_node = etree.SubElement( + payment_type_info, 'CtgyPurp') + category_purpose_code = etree.SubElement( + category_purpose_node, 'Cd') + category_purpose_code.text = category_purpose if gen_args['payment_method'] == 'DD': request_date_tag = 'ReqdColltnDt' else: diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index dde080637..c055ac5b4 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -13,10 +13,12 @@ class BankPaymentLine(models.Model): local_instrument = fields.Selection( related='payment_line_ids.local_instrument', string='Local Instrument') + category_purpose = fields.Selection( + related='payment_line_ids.category_purpose', string='Category Purpose') @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', 'local_instrument'] + res += ['priority', 'local_instrument', 'category_purpose'] return res diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml index e84958e63..925f43e49 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -13,7 +13,8 @@ - + + diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index f9496dffd..d6d05a9b3 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -13,7 +13,8 @@ - + + From f2f639d677053184c9943d063cb1f93c3586d54f Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Fri, 25 Nov 2016 20:04:32 -0500 Subject: [PATCH 77/79] OCA Transbot updated translations from Transifex --- account_banking_pain_base/i18n/de.po | 467 ++++++++++++++++++++++++ account_banking_pain_base/i18n/es.po | 268 +++++++++++--- account_banking_pain_base/i18n/fr.po | 49 ++- account_banking_pain_base/i18n/hr.po | 464 +++++++++++++++++++++++ account_banking_pain_base/i18n/nl.po | 247 ++++++++++--- account_banking_pain_base/i18n/pt_BR.po | 43 ++- account_banking_pain_base/i18n/sl.po | 231 +++++++++--- 7 files changed, 1571 insertions(+), 198 deletions(-) create mode 100644 account_banking_pain_base/i18n/de.po create mode 100644 account_banking_pain_base/i18n/hr.po diff --git a/account_banking_pain_base/i18n/de.po b/account_banking_pain_base/i18n/de.po new file mode 100644 index 000000000..79c2fa4d2 --- /dev/null +++ b/account_banking_pain_base/i18n/de.po @@ -0,0 +1,467 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# Niki Waibel, 2016 +# Niki Waibel, 2016 +# OCA Transbot , 2016 +# Pedro M. Baeza , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Líneas de pago bancario" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "Reserva por lotes" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Bonus Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "A cargo del acreedor" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "A cargo del deudor" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "No se puede procesar el campo '%s'." + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Card Bulk Clearing" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Cash Management Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "Category Purpose" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "A cargo del portador" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "Convertir a ASCII" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Deliver Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Dividend" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Fee Collection" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "Según el acuerdo de servicio" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor." + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Government Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Hedging" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "Alta" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "" +"If neither your bank nor your local regulations oblige you to set the " +"category purpose, leave the field empty." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "Si está marcado, el extracto bancario mostrará sólo una línea del haber para todos los adeudos directos del archivo SEPA; si no está marcado, entonces el extracto bancario mostrará una línea por cada adeudo directo del archivo SEPA." + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "Identificador del iniciador de la transacción" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "Emisor de la transacción" + +#. module: account_banking_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Interest" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Intra-Company Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Loan" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "Instrumento local" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:302 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la transacción' para la compañía '%s'. Ambos campos deben tener un valor." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "No se ha encontrado la ruta del archivo para el método de pago '%s'" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Other Payment" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "Versión PAIN" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Líneas de pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "Métodos de pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "Modos de pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Orden de pago" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Pension Payment" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Prioridad" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Receive Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "Pago SEPA" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Salary Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Securities" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "Compartidos" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Social Security Benefit" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Supplier Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Tax Payment" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "Esto se usará como el 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "Se usará este campo como 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo. Si no está definido, entonces se usará el 'Identificador del iniciador de la transacción' definido en la compañía.\nFormato común (13):\n- Código de país (2, opcional)\n- Identificador de la compañía (N, NIF)\n- Sufijo de servicio (N, emitido por el banco)" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "Este campo se usará como 'Emisor de la transacción' en los archivos PAIN generados por Odoo." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "Se usará este campo como 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo. Si no está definido, entonces se usará el 'Identificador del iniciador de la transacción' definido en la compañía.\nFormato común (13):\n- Código de país (2, opcional)\n- Identificador de la compañía (N, NIF)\n- Sufijo de servicio (N, emitido por el banco)" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade Settlement Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Treasury Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "VAT Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "WithHolding" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "account.config.settings" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "ePayment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "pain.001.001.02" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "pain.001.001.03 (recomendado para la transferencia de cŕedito)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "pain.001.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "pain.001.001.05" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "pain.001.003.03 (transferencia de crédito en Alemania)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "pain.008.001.02 (recomendado para el adeudo directo)" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "pain.008.001.03" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "pain.008.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "pain.008.003.02 (adeudo directo en Alemania)" diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po index 48180672a..5fd25fc12 100644 --- a/account_banking_pain_base/i18n/es.po +++ b/account_banking_pain_base/i18n/es.po @@ -4,14 +4,15 @@ # # Translators: # OCA Transbot , 2016 +# Pedro M. Baeza , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: bank-payment (10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 19:28+0000\n" -"PO-Revision-Date: 2016-07-01 19:28+0000\n" -"Last-Translator: OCA Transbot , 2016\n" -"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -26,35 +27,55 @@ msgstr "Líneas de pago bancario" #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking msgid "Batch Booking" +msgstr "Reserva por lotes" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Bonus Payment" msgstr "" #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Borne by Creditor" -msgstr "" +msgstr "A cargo del acreedor" #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Borne by Debtor" -msgstr "" +msgstr "A cargo del deudor" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" -"No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." +msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 #, python-format msgid "Cannot compute the '%s'." msgstr "No se puede procesar el campo '%s'." +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Card Bulk Clearing" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Cash Management Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "Category Purpose" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer msgid "Charge Bearer" -msgstr "" +msgstr "A cargo del portador" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_res_company @@ -66,10 +87,35 @@ msgstr "Compañías" msgid "Convert to ASCII" msgstr "Convertir a ASCII" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Deliver Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Dividend" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Fee Collection" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Following Service Level" -msgstr "" +msgstr "Según el acuerdo de servicio" #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer @@ -81,6 +127,16 @@ msgid "" "the creditor. Borne by creditor : all transaction charges are to be borne by" " the creditor. Borne by debtor : all transaction charges are to be borne by " "the debtor." +msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor." + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Government Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Hedging" msgstr "" #. module: account_banking_pain_base @@ -94,6 +150,14 @@ msgid "" "If active, Odoo will convert each accented character to the corresponding " "unaccented character, so that only ASCII characters are used in the " "generated PAIN file." +msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado." + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "" +"If neither your bank nor your local regulations oblige you to set the " +"category purpose, leave the field empty." msgstr "" #. module: account_banking_pain_base @@ -102,41 +166,71 @@ msgid "" "If true, the bank statement will display only one debit line for all the " "wire transfers of the SEPA XML file ; if false, the bank statement will " "display one debit line per wire transfer of the SEPA XML file." -msgstr "" +msgstr "Si está marcado, el extracto bancario mostrará sólo una línea del haber para todos los adeudos directos del archivo SEPA; si no está marcado, entonces el extracto bancario mostrará una línea por cada adeudo directo del archivo SEPA." #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "Identificador del iniciador de la transacción" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" msgstr "Emisor de la transacción" #. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument -#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument -msgid "Local Instrument" +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#: selection:account.payment.line,category_purpose:0 +msgid "Interest" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Intra-Company Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Loan" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "Instrumento local" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:302 #, python-format msgid "" "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " "the company '%s'. Both fields must have a value." -msgstr "" -"Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la " -"transacción' para la compañía '%s'. Ambos campos deben tener un valor." +msgstr "Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la transacción' para la compañía '%s'. Ambos campos deben tener un valor." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/models/account_payment_method.py:23 #, python-format msgid "No XSD file path found for payment method '%s'" -msgstr "" +msgstr "No se ha encontrado la ruta del archivo para el método de pago '%s'" #. module: account_banking_pain_base #: selection:account.payment.line,priority:0 @@ -144,33 +238,38 @@ msgid "Normal" msgstr "Normal" #. module: account_banking_pain_base -#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version -msgid "PAIN Version" +#: selection:account.payment.line,category_purpose:0 +msgid "Other Payment" msgstr "" #. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "Iniciación del pago" +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "Versión PAIN" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_line msgid "Payment Lines" -msgstr "" +msgstr "Líneas de pago" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_method msgid "Payment Methods" -msgstr "" +msgstr "Métodos de pago" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_mode msgid "Payment Modes" -msgstr "" +msgstr "Modos de pago" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_order msgid "Payment Order" +msgstr "Orden de pago" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Pension Payment" msgstr "" #. module: account_banking_pain_base @@ -179,38 +278,64 @@ msgstr "" msgid "Priority" msgstr "Prioridad" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Receive Against Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa msgid "SEPA Payment" +msgstr "Pago SEPA" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Salary Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Securities" msgstr "" #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Shared" +msgstr "Compartidos" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Social Security Benefit" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#: selection:account.payment.line,category_purpose:0 +msgid "Supplier Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Tax Payment" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " "Definition. The generated XML file and the full error have been written in " "the server logs. Here is the error, which may give you an idea on the cause " "of the problem : %s" -msgstr "" -"El archivo XML generado no se puede validar contra la definición de esquema " -"XML oficial. El archivo XML generado el error completo se ha escrito en los " -"registros del servidor. Aquí está el error, que le puede dar una idea de la " -"causa del problema : %s" +msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." @@ -221,16 +346,15 @@ msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode." msgid "" "This field will be used as 'Instruction Priority' in the generated PAIN " "file." -msgstr "" +msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado." #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "" "This will be used as the 'Initiating Party Identifier' in the PAIN files " "generated by Odoo." -msgstr "" -"Esto se usará como el 'Identificador del iniciador de la transacción' en los" -" archivos PAIN generados por Odoo." +msgstr "Esto se usará como el 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier @@ -240,16 +364,15 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" -msgstr "" +msgstr "Se usará este campo como 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo. Si no está definido, entonces se usará el 'Identificador del iniciador de la transacción' definido en la compañía.\nFormato común (13):\n- Código de país (2, opcional)\n- Identificador de la compañía (N, NIF)\n- Sufijo de servicio (N, emitido por el banco)" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "" "This will be used as the 'Initiating Party Issuer' in the PAIN files " "generated by Odoo." -msgstr "" -"Este campo se usará como 'Emisor de la transacción' en los archivos PAIN " -"generados por Odoo." +msgstr "Este campo se usará como 'Emisor de la transacción' en los archivos PAIN generados por Odoo." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer @@ -259,49 +382,84 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" +msgstr "Se usará este campo como 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo. Si no está definido, entonces se usará el 'Identificador del iniciador de la transacción' definido en la compañía.\nFormato común (13):\n- Código de país (2, opcional)\n- Identificador de la compañía (N, NIF)\n- Sufijo de servicio (N, emitido por el banco)" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade Settlement Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Treasury Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "VAT Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "WithHolding" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "account.config.settings" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "ePayment" msgstr "" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.02" -msgstr "" +msgstr "pain.001.001.02" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.03 (recommended for credit transfer)" -msgstr "" +msgstr "pain.001.001.03 (recomendado para la transferencia de cŕedito)" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.04" -msgstr "" +msgstr "pain.001.001.04" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.05" -msgstr "" +msgstr "pain.001.001.05" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.003.03 (credit transfer in Germany)" -msgstr "" +msgstr "pain.001.003.03 (transferencia de crédito en Alemania)" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.008.001.02 (recommended for direct debit)" -msgstr "" +msgstr "pain.008.001.02 (recomendado para el adeudo directo)" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.008.001.03" -msgstr "" +msgstr "pain.008.001.03" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.008.001.04" -msgstr "" +msgstr "pain.008.001.04" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.008.003.02 (direct debit in Germany)" -msgstr "" +msgstr "pain.008.003.02 (adeudo directo en Alemania)" diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index 52d684034..624a55222 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -6,12 +6,12 @@ # OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: bank-payment (10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 19:28+0000\n" -"PO-Revision-Date: 2016-07-01 19:28+0000\n" -"Last-Translator: OCA Transbot , 2016\n" -"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"POT-Creation-Date: 2016-11-21 10:17+0000\n" +"PO-Revision-Date: 2016-10-19 23:45+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -39,15 +39,13 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" -"Impossible de calculer le '%s' de la ligne de paiement ayant la référence " -"'%s'." +msgstr "Impossible de calculer le '%s' de la ligne de paiement ayant la référence '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 #, python-format msgid "Cannot compute the '%s'." msgstr "Impossible de calculer le '%s'." @@ -106,12 +104,14 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" @@ -124,7 +124,7 @@ msgid "Local Instrument" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:297 #, python-format msgid "" "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " @@ -147,11 +147,6 @@ msgstr "Normal" msgid "PAIN Version" msgstr "" -#. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "Payment Initiation" - #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_line msgid "Payment Lines" @@ -189,31 +184,26 @@ msgid "Shared" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " "Definition. The generated XML file and the full error have been written in " "the server logs. Here is the error, which may give you an idea on the cause " "of the problem : %s" -msgstr "" -"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma" -" XML officiel. Le fichier XML généré et le message d'erreur complet ont été " -"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " -"une idée sur la cause du problème : %s" +msgstr "Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma XML officiel. Le fichier XML généré et le message d'erreur complet ont été écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être une idée sur la cause du problème : %s" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" -"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." +msgstr "Le type du champ '%s' est %s. Il devrait être de type string ou unicode." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority @@ -224,6 +214,7 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "" "This will be used as the 'Initiating Party Identifier' in the PAIN files " @@ -241,6 +232,7 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "" "This will be used as the 'Initiating Party Issuer' in the PAIN files " @@ -257,6 +249,11 @@ msgid "" "- Service suffix (N, issued by bank)" msgstr "" +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.02" diff --git a/account_banking_pain_base/i18n/hr.po b/account_banking_pain_base/i18n/hr.po new file mode 100644 index 000000000..4fc891c1e --- /dev/null +++ b/account_banking_pain_base/i18n/hr.po @@ -0,0 +1,464 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 00:10+0000\n" +"PO-Revision-Date: 2017-07-12 06:44+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line +msgid "Bank Payment Lines" +msgstr "Stavke izvoda" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "Batch Booking" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Bonus Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Card Bulk Clearing" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Cash Management Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "Category Purpose" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "Charge Bearer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "Convert to ASCII" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Deliver Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Dividend" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Fee Collection" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_charge_bearer +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Government Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Hedging" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_method_convert_to_ascii +msgid "" +"If active, Odoo will convert each accented character to the corresponding " +"unaccented character, so that only ASCII characters are used in the " +"generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "" +"If neither your bank nor your local regulations oblige you to set the " +"category purpose, leave the field empty." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "Initiating Party Identifier" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +#: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Interest" +msgstr "Kamata" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Intra-Company Payment" +msgstr "Plaćanje između poduzeća" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Loan" +msgstr "Pozajmica" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument +msgid "Local Instrument" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:302 +#, python-format +msgid "" +"Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " +"the company '%s'. Both fields must have a value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_method.py:23 +#, python-format +msgid "No XSD file path found for payment method '%s'" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,priority:0 +msgid "Normal" +msgstr "Normalno" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Other Payment" +msgstr "Ostala plaćanja" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version +msgid "PAIN Version" +msgstr "PAIN verzija" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Stavke plaćanja" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_method +msgid "Payment Methods" +msgstr "Metode plaćanja" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_mode +msgid "Payment Modes" +msgstr "Modeli plaćanja" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Nalog za plaćanje" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Pension Payment" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority +msgid "Priority" +msgstr "Prioritet" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Receive Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa +msgid "SEPA Payment" +msgstr "SEPA plaćanje" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Salary Payment" +msgstr "Isplata plaće" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Securities" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.order,charge_bearer:0 +msgid "Shared" +msgstr "Dieljeno" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Social Security Benefit" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Supplier Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Tax Payment" +msgstr "PLaćanje poreza" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_priority +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_priority +msgid "" +"This field will be used as 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier +msgid "" +"This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo. If not defined, Initiating Party Identifier from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer +#: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by Odoo." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo. If not defined, Initiating Party Issuer from company will be used.\n" +"Common format (13): \n" +"- Country code (2, optional)\n" +"- Company idenfier (N, VAT)\n" +"- Service suffix (N, issued by bank)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade Settlement Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Treasury Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "VAT Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "WithHolding" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "ePayment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.02" +msgstr "pain.001.001.02" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.03 (recommended for credit transfer)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.04" +msgstr "pain.001.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.001.05" +msgstr "pain.001.001.05" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.001.003.03 (credit transfer in Germany)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.02 (recommended for direct debit)" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.03" +msgstr "pain.008.001.03" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.001.04" +msgstr "pain.008.001.04" + +#. module: account_banking_pain_base +#: selection:account.payment.method,pain_version:0 +msgid "pain.008.003.02 (direct debit in Germany)" +msgstr "" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po index 5366496ad..d6cfbe50c 100644 --- a/account_banking_pain_base/i18n/nl.po +++ b/account_banking_pain_base/i18n/nl.po @@ -6,12 +6,12 @@ # Erwin van der Ploeg , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: bank-payment (10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-22 23:52+0000\n" -"PO-Revision-Date: 2016-07-22 23:52+0000\n" -"Last-Translator: Erwin van der Ploeg , 2016\n" -"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/nl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -28,6 +28,11 @@ msgstr "Bank betaalregels" msgid "Batch Booking" msgstr "Batch verwerking" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Bonus Payment" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Borne by Creditor" @@ -39,17 +44,33 @@ msgid "Borne by Debtor" msgstr "Ten laste van de Debiteur" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 #, python-format msgid "Cannot compute the '%s'." msgstr "Kan de '%s' niet berekenen." +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Card Bulk Clearing" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Cash Management Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "Category Purpose" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer msgid "Charge Bearer" @@ -65,6 +86,31 @@ msgstr "Bedrijven" msgid "Convert to ASCII" msgstr "Converteer naar ASCII" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Deliver Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Dividend" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Fee Collection" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Following Service Level" @@ -80,14 +126,17 @@ msgid "" "the creditor. Borne by creditor : all transaction charges are to be borne by" " the creditor. Borne by debtor : all transaction charges are to be borne by " "the debtor." +msgstr "Volgens Service Level: transactiekosten worden toegepast volgens de regels vastgelegd in het service level en/of schema (SEPA Core berichten gebruiken dit). Gedeeld: transactiekosten aan de debiteurzijde komen ten laste van de debiteur, transactiekosten aan crediteurszijde komen ten laste van de crediteur. Ten laste van de crediteur: alle transactiekosten komen ten laste van de crediteur. Ten laste van de Debiteur: alle transactiekosten komen ten laste van de debiteur. " + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Government Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Hedging" msgstr "" -"Volgens Service Level: transactiekosten worden toegepast volgens de regels " -"vastgelegd in het service level en/of schema (SEPA Core berichten gebruiken " -"dit). Gedeeld: transactiekosten aan de debiteurzijde komen ten laste van de " -"debiteur, transactiekosten aan crediteurszijde komen ten laste van de " -"crediteur. Ten laste van de crediteur: alle transactiekosten komen ten laste" -" van de crediteur. Ten laste van de Debiteur: alle transactiekosten komen " -"ten laste van de debiteur. " #. module: account_banking_pain_base #: selection:account.payment.line,priority:0 @@ -100,10 +149,15 @@ msgid "" "If active, Odoo will convert each accented character to the corresponding " "unaccented character, so that only ASCII characters are used in the " "generated PAIN file." +msgstr "Wanneer actief, zal Odoo geaccentueerde karakters omzetten naar het corresponderende niet geaccentueerde karakter, dit zodat alleen ASCII gebruikt wordt in de gegenereerde PAIN file. " + +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "" +"If neither your bank nor your local regulations oblige you to set the " +"category purpose, leave the field empty." msgstr "" -"Wanneer actief, zal Odoo geaccentueerde karakters omzetten naar het " -"corresponderende niet geaccentueerde karakter, dit zodat alleen ASCII " -"gebruikt wordt in de gegenereerde PAIN file. " #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking @@ -111,23 +165,52 @@ msgid "" "If true, the bank statement will display only one debit line for all the " "wire transfers of the SEPA XML file ; if false, the bank statement will " "display one debit line per wire transfer of the SEPA XML file." -msgstr "" -"Wanneer waar, zal het bankafschrift één debit lijn bevatten voor alle " -"overschrijvingen in het SEPA bestand; wanneer onwaar, zal het bankafschrift " -"een debit lijn per overschrijving bevatten in het SEPA bestand. " +msgstr "Wanneer waar, zal het bankafschrift één debit lijn bevatten voor alle overschrijvingen in het SEPA bestand; wanneer onwaar, zal het bankafschrift een debit lijn per overschrijving bevatten in het SEPA bestand. " #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "Initiating Party Identifier" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" msgstr "Initiating Party Issuer" +#. module: account_banking_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Interest" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Intra-Company Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Loan" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument #: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument @@ -135,14 +218,12 @@ msgid "Local Instrument" msgstr "Lokaal Instrument" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:302 #, python-format msgid "" "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " "the company '%s'. Both fields must have a value." -msgstr "" -"Missende 'Initiating Party Issuer' en/of 'Initiating Party Identifier' voor " -"het bedrijf '%s'. Beide velden moet een waarde bevatten." +msgstr "Missende 'Initiating Party Issuer' en/of 'Initiating Party Identifier' voor het bedrijf '%s'. Beide velden moet een waarde bevatten." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/models/account_payment_method.py:23 @@ -155,16 +236,16 @@ msgstr "Geen XSD bestandlocatie gevonden voor betaalmethode '%s'." msgid "Normal" msgstr "Normaal" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Other Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version msgid "PAIN Version" msgstr "PAIN Versie" -#. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "Payment Initiation" - #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_line msgid "Payment Lines" @@ -185,44 +266,75 @@ msgstr "Betaalmode" msgid "Payment Order" msgstr "Betalingsopdracht" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Pension Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority #: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_priority msgid "Priority" msgstr "Prioriteit" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Receive Against Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa msgid "SEPA Payment" msgstr "SEPA betaling" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Salary Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Securities" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Shared" msgstr "Gedeeld" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#: selection:account.payment.line,category_purpose:0 +msgid "Social Security Benefit" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Supplier Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Tax Payment" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " "Definition. The generated XML file and the full error have been written in " "the server logs. Here is the error, which may give you an idea on the cause " "of the problem : %s" -msgstr "" -"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema " -"definities. Het gegenereerde XML bestand en de volledige fout zijn " -"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee " -"kunt geven over de oorzaak van het probleem: %s\"" +msgstr "Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema definities. Het gegenereerde XML bestand en de volledige fout zijn weggeschreven in de server log bestanden. Hier is de fout, wat u een idee kunt geven over de oorzaak van het probleem: %s\"" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." @@ -233,18 +345,15 @@ msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." msgid "" "This field will be used as 'Instruction Priority' in the generated PAIN " "file." -msgstr "" -"Dit veld wordt gebruikt als 'Instructie Prioriteit' in het gegeneerde PAIN " -"bestand." +msgstr "Dit veld wordt gebruikt als 'Instructie Prioriteit' in het gegeneerde PAIN bestand." #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "" "This will be used as the 'Initiating Party Identifier' in the PAIN files " "generated by Odoo." -msgstr "" -"Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN " -"bestanden." +msgstr "Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN bestanden." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier @@ -254,19 +363,15 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" -msgstr "" -"Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN " -"bestanden. Wanneer niet ingesteld wordt de Initiating Party Identifier uit " -"de bedrijfsinstellingen gebruikt." +msgstr "Wordt gebruikt als 'Initiating Party Identifier' in de gegenereerde PAIN bestanden. Wanneer niet ingesteld wordt de Initiating Party Identifier uit de bedrijfsinstellingen gebruikt." #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "" "This will be used as the 'Initiating Party Issuer' in the PAIN files " "generated by Odoo." -msgstr "" -"Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN " -"bestanden." +msgstr "Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN bestanden." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer @@ -276,12 +381,42 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" +msgstr "Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN bestanden. Wanneer niet ingesteld wordt de Initiating Party Issuer uit de bedrijfsinstellingen gebruikt.\nStandaard formaat(13):\n- Land Code (2, optioneel)\n- Bedrijfsidentificatie (N, BTWnr)\n- Service achtervoegsel (N, uitgegeven door de bank)" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade Settlement Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Treasury Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "VAT Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "WithHolding" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "account.config.settings" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "ePayment" msgstr "" -"Wordt gebruikt als 'Initiating Party Issuer' in de gegenereerde PAIN bestanden. Wanneer niet ingesteld wordt de Initiating Party Issuer uit de bedrijfsinstellingen gebruikt.\n" -"Standaard formaat(13):\n" -"- Land Code (2, optioneel)\n" -"- Bedrijfsidentificatie (N, BTWnr)\n" -"- Service achtervoegsel (N, uitgegeven door de bank)" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 diff --git a/account_banking_pain_base/i18n/pt_BR.po b/account_banking_pain_base/i18n/pt_BR.po index effa436b0..ca1f8a771 100644 --- a/account_banking_pain_base/i18n/pt_BR.po +++ b/account_banking_pain_base/i18n/pt_BR.po @@ -6,12 +6,12 @@ # OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: bank-payment (10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 19:28+0000\n" -"PO-Revision-Date: 2016-07-01 19:28+0000\n" -"Last-Translator: OCA Transbot , 2016\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"POT-Creation-Date: 2016-11-21 10:17+0000\n" +"PO-Revision-Date: 2016-10-19 23:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -39,14 +39,13 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" -"Não foi possível calcular a '%s' da linha de pagamento com referência '%s'" +msgstr "Não foi possível calcular a '%s' da linha de pagamento com referência '%s'" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 #, python-format msgid "Cannot compute the '%s'." msgstr "Não foi possível computar o '%s'" @@ -105,12 +104,14 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" @@ -123,7 +124,7 @@ msgid "Local Instrument" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:297 #, python-format msgid "" "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " @@ -146,15 +147,10 @@ msgstr "Normal" msgid "PAIN Version" msgstr "" -#. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "" - #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_line msgid "Payment Lines" -msgstr "" +msgstr "Linhas do pagamento" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_method @@ -169,7 +165,7 @@ msgstr "" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_order msgid "Payment Order" -msgstr "" +msgstr "Ordem de Pagamento" #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_priority @@ -188,13 +184,13 @@ msgid "Shared" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " @@ -204,7 +200,7 @@ msgid "" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "" @@ -218,6 +214,7 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "" "This will be used as the 'Initiating Party Identifier' in the PAIN files " @@ -235,6 +232,7 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "" "This will be used as the 'Initiating Party Issuer' in the PAIN files " @@ -251,6 +249,11 @@ msgid "" "- Service suffix (N, issued by bank)" msgstr "" +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 msgid "pain.001.001.02" diff --git a/account_banking_pain_base/i18n/sl.po b/account_banking_pain_base/i18n/sl.po index 109ad0388..f1fb6334d 100644 --- a/account_banking_pain_base/i18n/sl.po +++ b/account_banking_pain_base/i18n/sl.po @@ -6,12 +6,12 @@ # OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: bank-payment (10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-01 19:28+0000\n" -"PO-Revision-Date: 2016-07-01 19:28+0000\n" -"Last-Translator: OCA Transbot , 2016\n" -"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -28,6 +28,11 @@ msgstr "Postavke bančnih plačil" msgid "Batch Booking" msgstr "" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Bonus Payment" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Borne by Creditor" @@ -39,17 +44,33 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:106 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:105 #, python-format msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." msgstr "Ne morem izračunati '%s' plačilne postavke s sklicem '%s'." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:111 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:110 #, python-format msgid "Cannot compute the '%s'." msgstr "Ne morem izračunati '%s'." +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Card Bulk Clearing" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Cash Management Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "Category Purpose" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_charge_bearer msgid "Charge Bearer" @@ -65,6 +86,31 @@ msgstr "Družbe" msgid "Convert to ASCII" msgstr "Pretvori v ASCII" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Deliver Against Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Dividend" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Fee Collection" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Following Service Level" @@ -82,6 +128,16 @@ msgid "" "the debtor." msgstr "" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Government Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Hedging" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.line,priority:0 msgid "High" @@ -95,6 +151,14 @@ msgid "" "generated PAIN file." msgstr "" +#. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_line_category_purpose +#: model:ir.model.fields,help:account_banking_pain_base.field_bank_payment_line_category_purpose +msgid "" +"If neither your bank nor your local regulations oblige you to set the " +"category purpose, leave the field empty." +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_order_batch_booking msgid "" @@ -104,17 +168,49 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "Initiating Party Identifier" msgstr "Identifikator začetne stranke" #. module: account_banking_pain_base +#: model:ir.model.fields,field_description:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer #: model:ir.model.fields,field_description:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "Initiating Party Issuer" msgstr "Izdajatelj začetne stranke" +#. module: account_banking_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Interest" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Intra-Company Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Credit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Irrevocable Debit Card Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Loan" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_line_local_instrument #: model:ir.model.fields,field_description:account_banking_pain_base.field_bank_payment_line_local_instrument @@ -122,14 +218,12 @@ msgid "Local Instrument" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:298 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:302 #, python-format msgid "" "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for " "the company '%s'. Both fields must have a value." -msgstr "" -"Manjkajoči 'Izdajatelj začetne stranke' in/ali 'Identifikator začetne " -"stranke' pri družbi '%s'. Obe polji morata vsebovati vrednost." +msgstr "Manjkajoči 'Izdajatelj začetne stranke' in/ali 'Identifikator začetne stranke' pri družbi '%s'. Obe polji morata vsebovati vrednost." #. module: account_banking_pain_base #: code:addons/account_banking_pain_base/models/account_payment_method.py:23 @@ -142,20 +236,20 @@ msgstr "" msgid "Normal" msgstr "Običajna" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Other Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_method_pain_version msgid "PAIN Version" msgstr "" -#. module: account_banking_pain_base -#: model:ir.ui.view,arch_db:account_banking_pain_base.view_company_form -msgid "Payment Initiation" -msgstr "Začetek plačil" - #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_line msgid "Payment Lines" -msgstr "" +msgstr "Plačilne postavke" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_method @@ -170,6 +264,11 @@ msgstr "" #. module: account_banking_pain_base #: model:ir.model,name:account_banking_pain_base.model_account_payment_order msgid "Payment Order" +msgstr "Plačilni nalog" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Pension Payment" msgstr "" #. module: account_banking_pain_base @@ -178,37 +277,64 @@ msgstr "" msgid "Priority" msgstr "Prioriteta" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Receive Against Payment" +msgstr "" + #. module: account_banking_pain_base #: model:ir.model.fields,field_description:account_banking_pain_base.field_account_payment_order_sepa msgid "SEPA Payment" msgstr "" +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Salary Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Securities" +msgstr "" + #. module: account_banking_pain_base #: selection:account.payment.order,charge_bearer:0 msgid "Shared" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:119 +#: selection:account.payment.line,category_purpose:0 +msgid "Social Security Benefit" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Supplier Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Tax Payment" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/account_payment_order.py:118 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "'%s' je prazno ali 0. Vsebovati bi moralo ne ničelno vrednost." #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:140 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:139 #, python-format msgid "" "The generated XML file is not valid against the official XML Schema " "Definition. The generated XML file and the full error have been written in " "the server logs. Here is the error, which may give you an idea on the cause " "of the problem : %s" -msgstr "" -"Ustvarjena XML datoteka ni v skladu z uradno definicijo XML sheme. " -"Ustvarjena XML datoteka in celotna napaka sta zapisani v strežniške " -"dnevnike. Tu je napaka, ki bi lahko razjasnila, v čem je vzrok težave : %s" +msgstr "Ustvarjena XML datoteka ni v skladu z uradno definicijo XML sheme. Ustvarjena XML datoteka in celotna napaka sta zapisani v strežniške dnevnike. Tu je napaka, ki bi lahko razjasnila, v čem je vzrok težave : %s" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/models/account_payment_order.py:114 +#: code:addons/account_banking_pain_base/models/account_payment_order.py:113 #, python-format msgid "The type of the field '%s' is %s. It should be a string or unicode." msgstr "Tip polja '%s' je %s. Moral bi biti niz ali unicode." @@ -222,13 +348,12 @@ msgid "" msgstr "" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_identifier #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_identifier msgid "" "This will be used as the 'Initiating Party Identifier' in the PAIN files " "generated by Odoo." -msgstr "" -"To se uporabi kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih " -"ustvari Odoo." +msgstr "To se uporabi kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih ustvari Odoo." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_identifier @@ -238,21 +363,15 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" -msgstr "" -"To bo uporabljeno kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\n" -"Običajni format (13): \n" -"- Koda države (2, optional)\n" -"- Identifikator družbe (ID za DDV)\n" -"- Pripona storitve (številka, ki jo poda banka)" +msgstr "To bo uporabljeno kot 'Identifikator začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\nObičajni format (13): \n- Koda države (2, optional)\n- Identifikator družbe (ID za DDV)\n- Pripona storitve (številka, ki jo poda banka)" #. module: account_banking_pain_base +#: model:ir.model.fields,help:account_banking_pain_base.field_account_config_settings_initiating_party_issuer #: model:ir.model.fields,help:account_banking_pain_base.field_res_company_initiating_party_issuer msgid "" "This will be used as the 'Initiating Party Issuer' in the PAIN files " "generated by Odoo." -msgstr "" -"To se uporabi kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih " -"ustvari Odoo." +msgstr "To se uporabi kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih ustvari Odoo." #. module: account_banking_pain_base #: model:ir.model.fields,help:account_banking_pain_base.field_account_payment_mode_initiating_party_issuer @@ -262,12 +381,42 @@ msgid "" "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)" +msgstr "To bo uporabljeno kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\nObičajni format (13): \n- Koda države (2, optional)\n- Identifikator družbe (ID za DDV)\n- Pripona storitve (številka, ki jo poda banka)" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Trade Settlement Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "Treasury Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "VAT Payment" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "WithHolding" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_account_config_settings +msgid "account.config.settings" +msgstr "" + +#. module: account_banking_pain_base +#: selection:account.payment.line,category_purpose:0 +msgid "ePayment" msgstr "" -"To bo uporabljeno kot 'Izdajatelj začetne stranke' v PAIN datotekah, ki jih ustvari Odoo. Če ni določeno, se uporabi 'Identifikator začetne stranke' iz obrazca družbe.\n" -"Običajni format (13): \n" -"- Koda države (2, optional)\n" -"- Identifikator družbe (ID za DDV)\n" -"- Pripona storitve (številka, ki jo poda banka)" #. module: account_banking_pain_base #: selection:account.payment.method,pain_version:0 From f10ac256344a48293bb1e1b2d953fa035967fb5a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 18 Aug 2017 19:59:31 +0200 Subject: [PATCH 78/79] [IMP] account_banking*: Show identifiers at payment mode level Now the visibility is controlled through a security group. --- account_banking_pain_base/README.rst | 23 +++++++++++++++---- account_banking_pain_base/__manifest__.py | 10 ++++---- .../models/account_config_settings.py | 10 +++++++- .../security/security.xml | 10 ++++++++ .../views/account_config_settings.xml | 3 ++- .../views/account_payment_mode.xml | 7 +++--- 6 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 account_banking_pain_base/security/security.xml diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index 5e7f4774c..c81a1df7d 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -25,7 +25,18 @@ This module is part of the OCA/bank-payment suite. Configuration ============= -No configuration required. +#. Go to Accounting > Configuration > Settings. +#. On the fields "Initiating Party Issuer" and "Initiating Party Identifier", + in the section *SEPA/PAIN*, you can fill the corresponding identifiers. + +If your country requires several identifiers (like Spain), you must: + +#. Go to *Accounting > Configuration > Settings*. +#. On the section *SEPA/PAIN*, check the mark "Multiple identifiers". +#. Now go to *Accounting > Configuration > Management > Payment Modes*. +#. Create a payment mode for your specific bank. +#. Fill the specific identifiers on the fields "Initiating Party Identifier" + and "Initiating Party Issuer". Usage ===== @@ -34,7 +45,7 @@ See 'readme' files of the OCA/bank-payment suite. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/173/9.0 + :target: https://runbot.odoo-community.org/runbot/173/10.0 Known issues / Roadmap ====================== @@ -70,10 +81,12 @@ Maintainer .. image:: http://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index 173527f99..750b5808e 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -1,26 +1,26 @@ # -*- coding: utf-8 -*- -# © 2013-2016 Akretion - Alexis de Lattre -# © 2014 Tecnativa - Pedro M. Baeza -# © 2016 Tecnativa - Antonio Espinosa +# Copyright 2013-2016 Akretion - Alexis de Lattre +# Copyright 2014-2017 Tecnativa - Pedro M. Baeza +# Copyright 2016 Tecnativa - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '10.0.1.0.0', + 'version': '10.0.1.1.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " "Tecnativa, " "Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', - 'contributors': ['Pedro M. Baeza '], 'category': 'Hidden', 'depends': ['account_payment_order'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], }, 'data': [ + 'security/security.xml', 'views/account_payment_line.xml', 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', diff --git a/account_banking_pain_base/models/account_config_settings.py b/account_banking_pain_base/models/account_config_settings.py index 0a7caba0f..ed8c17da3 100644 --- a/account_banking_pain_base/models/account_config_settings.py +++ b/account_banking_pain_base/models/account_config_settings.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion - Alexis de Lattre +# Copyright 2016 Akretion - Alexis de Lattre +# Copyright 2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields @@ -12,3 +13,10 @@ class AccountConfigSettings(models.TransientModel): related='company_id.initiating_party_issuer') initiating_party_identifier = fields.Char( related='company_id.initiating_party_identifier') + group_pain_multiple_identifier = fields.Boolean( + string='Multiple identifiers', + implied_group='account_banking_pain_base.' + 'group_pain_multiple_identifier', + help="Enable this option if your country requires several SEPA/PAIN " + "identifiers like in Spain.", + ) diff --git a/account_banking_pain_base/security/security.xml b/account_banking_pain_base/security/security.xml new file mode 100644 index 000000000..4915015a1 --- /dev/null +++ b/account_banking_pain_base/security/security.xml @@ -0,0 +1,10 @@ + + + + + SEPA/PAIN Identifiers on Payment Modes + + + + + diff --git a/account_banking_pain_base/views/account_config_settings.xml b/account_banking_pain_base/views/account_config_settings.xml index 059b3e02e..9cdd2548e 100644 --- a/account_banking_pain_base/views/account_config_settings.xml +++ b/account_banking_pain_base/views/account_config_settings.xml @@ -12,9 +12,10 @@ - + + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index 5cb2b4d02..67f796329 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -1,7 +1,7 @@ @@ -13,9 +13,8 @@ - - - + + From 1fabf8ca23258422dde2727183408f3cb3ec6036 Mon Sep 17 00:00:00 2001 From: etobella Date: Mon, 16 Oct 2017 17:20:40 +0200 Subject: [PATCH 79/79] [MIG] account_banking_pain_base --- account_banking_pain_base/README.rst | 10 ++--- account_banking_pain_base/__init__.py | 3 +- account_banking_pain_base/__manifest__.py | 7 ++- account_banking_pain_base/models/__init__.py | 4 +- .../models/account_payment_line.py | 3 +- .../models/account_payment_method.py | 3 +- .../models/account_payment_mode.py | 3 +- .../models/account_payment_order.py | 13 +++--- .../models/bank_payment_line.py | 3 +- .../models/res_company.py | 7 ++- ...fig_settings.py => res_config_settings.py} | 9 ++-- account_banking_pain_base/post_install.py | 7 ++- .../views/account_config_settings.xml | 25 ----------- .../views/account_payment_line.xml | 2 +- .../views/account_payment_mode.xml | 2 +- .../views/account_payment_order.xml | 2 +- .../views/bank_payment_line_view.xml | 2 +- .../views/res_config_settings.xml | 44 +++++++++++++++++++ .../odoo/__init__.py | 1 + .../odoo/addons/__init__.py | 1 + .../odoo/addons/account_banking_pain_base | 1 + setup/account_banking_pain_base/setup.cfg | 2 + setup/account_banking_pain_base/setup.py | 6 +++ 23 files changed, 89 insertions(+), 71 deletions(-) rename account_banking_pain_base/models/{account_config_settings.py => res_config_settings.py} (74%) delete mode 100644 account_banking_pain_base/views/account_config_settings.xml create mode 100644 account_banking_pain_base/views/res_config_settings.xml create mode 100644 setup/account_banking_pain_base/odoo/__init__.py create mode 100644 setup/account_banking_pain_base/odoo/addons/__init__.py create mode 120000 setup/account_banking_pain_base/odoo/addons/account_banking_pain_base create mode 100644 setup/account_banking_pain_base/setup.cfg create mode 100644 setup/account_banking_pain_base/setup.py diff --git a/account_banking_pain_base/README.rst b/account_banking_pain_base/README.rst index c81a1df7d..c24b1e059 100644 --- a/account_banking_pain_base/README.rst +++ b/account_banking_pain_base/README.rst @@ -25,15 +25,15 @@ This module is part of the OCA/bank-payment suite. Configuration ============= -#. Go to Accounting > Configuration > Settings. +#. Go to Invoicing/Accounting > Configuration > Settings. #. On the fields "Initiating Party Issuer" and "Initiating Party Identifier", in the section *SEPA/PAIN*, you can fill the corresponding identifiers. If your country requires several identifiers (like Spain), you must: -#. Go to *Accounting > Configuration > Settings*. +#. Go to *Invoicing/Accounting > Configuration > Settings*. #. On the section *SEPA/PAIN*, check the mark "Multiple identifiers". -#. Now go to *Accounting > Configuration > Management > Payment Modes*. +#. Now go to *Invoicing/Accounting > Configuration > Management > Payment Modes*. #. Create a payment mode for your specific bank. #. Fill the specific identifiers on the fields "Initiating Party Identifier" and "Initiating Party Issuer". @@ -45,7 +45,7 @@ See 'readme' files of the OCA/bank-payment suite. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/173/10.0 + :target: https://runbot.odoo-community.org/runbot/173/11.0 Known issues / Roadmap ====================== @@ -79,7 +79,7 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py index 44319ee0a..dd2c1ae77 100644 --- a/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # © 2013 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models from .post_install import set_default_initiating_party diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index 750b5808e..becfce31b 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2016 Akretion - Alexis de Lattre # Copyright 2014-2017 Tecnativa - Pedro M. Baeza # Copyright 2016 Tecnativa - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': 'Account Banking PAIN Base Module', 'summary': 'Base module for PAIN file generation', - 'version': '10.0.1.1.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Noviat, " @@ -25,7 +24,7 @@ 'views/account_payment_order.xml', 'views/bank_payment_line_view.xml', 'views/account_payment_mode.xml', - 'views/account_config_settings.xml', + 'views/res_config_settings.xml', 'views/account_payment_method.xml', ], 'post_init_hook': 'set_default_initiating_party', diff --git a/account_banking_pain_base/models/__init__.py b/account_banking_pain_base/models/__init__.py index 828efee19..5e5e13d56 100644 --- a/account_banking_pain_base/models/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- - from . import account_payment_line from . import account_payment_order from . import bank_payment_line from . import account_payment_mode from . import res_company -from . import account_config_settings +from . import res_config_settings from . import account_payment_method diff --git a/account_banking_pain_base/models/account_payment_line.py b/account_banking_pain_base/models/account_payment_line.py index a460b9551..589c3617b 100644 --- a/account_banking_pain_base/models/account_payment_line.py +++ b/account_banking_pain_base/models/account_payment_line.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index f7623a5d6..07f9b6f22 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _ from odoo.exceptions import UserError diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index 95ff0be79..431ebc490 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 751096e22..21e6f81f4 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _, tools from odoo.exceptions import UserError @@ -108,7 +107,7 @@ class AccountPaymentOrder(models.Model): else: raise UserError( _("Cannot compute the '%s'.") % field_name) - if not isinstance(value, (str, unicode)): + if not isinstance(value, str): raise UserError( _("The type of the field '%s' is %s. It should be a string " "or unicode.") @@ -130,7 +129,7 @@ class AccountPaymentOrder(models.Model): try: root_to_validate = etree.fromstring(xml_string) official_pain_schema.assertValid(root_to_validate) - except Exception, e: + except Exception as e: logger.warning( "The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) @@ -141,7 +140,7 @@ class AccountPaymentOrder(models.Model): "full error have been written in the server logs. Here " "is the error, which may give you an idea on the cause " "of the problem : %s") - % unicode(e)) + % str(e)) return True @api.multi @@ -189,7 +188,7 @@ class AccountPaymentOrder(models.Model): # batch_booking is in "Group header" with pain.001.001.02 # and in "Payment info" in pain.001.001.03/04 batch_booking = etree.SubElement(group_header, 'BtchBookg') - batch_booking.text = unicode(self.batch_booking).lower() + batch_booking.text = str(self.batch_booking).lower() nb_of_transactions = etree.SubElement( group_header, 'NbOfTxs') control_sum = etree.SubElement(group_header, 'CtrlSum') @@ -217,7 +216,7 @@ class AccountPaymentOrder(models.Model): control_sum = False if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking = etree.SubElement(payment_info, 'BtchBookg') - batch_booking.text = unicode(self.batch_booking).lower() + batch_booking.text = str(self.batch_booking).lower() # The "SEPA Customer-to-bank # Implementation guidelines" for SCT and SDD says that control sum # and nb_of_transactions should be present diff --git a/account_banking_pain_base/models/bank_payment_line.py b/account_banking_pain_base/models/bank_payment_line.py index c055ac5b4..809f75dbb 100644 --- a/account_banking_pain_base/models/bank_payment_line.py +++ b/account_banking_pain_base/models/bank_payment_line.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api diff --git a/account_banking_pain_base/models/res_company.py b/account_banking_pain_base/models/res_company.py index 82e9d2711..127d8e179 100644 --- a/account_banking_pain_base/models/res_company.py +++ b/account_banking_pain_base/models/res_company.py @@ -1,10 +1,9 @@ -# -*- coding: utf-8 -*- # © 2013-2016 Akretion - Alexis de Lattre # © 2013 Noviat (http://www.noviat.com) - Luc de Meyer # © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api +from odoo import models, fields import logging logger = logging.getLogger(__name__) @@ -22,9 +21,9 @@ class ResCompany(models.Model): help="This will be used as the 'Initiating Party Identifier' in " "the PAIN files generated by Odoo.") - @api.one def _default_initiating_party(self): '''This method is called from post_install.py''' + self.ensure_one() party_issuer_per_country = { 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium } diff --git a/account_banking_pain_base/models/account_config_settings.py b/account_banking_pain_base/models/res_config_settings.py similarity index 74% rename from account_banking_pain_base/models/account_config_settings.py rename to account_banking_pain_base/models/res_config_settings.py index ed8c17da3..c59e4569d 100644 --- a/account_banking_pain_base/models/account_config_settings.py +++ b/account_banking_pain_base/models/res_config_settings.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Akretion - Alexis de Lattre # Copyright 2017 Tecnativa - Pedro M. Baeza -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models -class AccountConfigSettings(models.TransientModel): - _inherit = 'account.config.settings' +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' initiating_party_issuer = fields.Char( related='company_id.initiating_party_issuer') diff --git a/account_banking_pain_base/post_install.py b/account_banking_pain_base/post_install.py index df73e14d7..c438db127 100644 --- a/account_banking_pain_base/post_install.py +++ b/account_banking_pain_base/post_install.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # © 2015-2016 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, SUPERUSER_ID @@ -9,6 +8,6 @@ from odoo import api, SUPERUSER_ID def set_default_initiating_party(cr, registry): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) - companies = env['res.company'].search([]) - companies._default_initiating_party() + for company in env['res.company'].search([]): + company._default_initiating_party() return diff --git a/account_banking_pain_base/views/account_config_settings.xml b/account_banking_pain_base/views/account_config_settings.xml deleted file mode 100644 index 9cdd2548e..000000000 --- a/account_banking_pain_base/views/account_config_settings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - pain.group.on.account.config.settings - account.config.settings - - - - - - - - - - - - - - diff --git a/account_banking_pain_base/views/account_payment_line.xml b/account_banking_pain_base/views/account_payment_line.xml index 925f43e49..8f8b154df 100644 --- a/account_banking_pain_base/views/account_payment_line.xml +++ b/account_banking_pain_base/views/account_payment_line.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index 67f796329..5401bde00 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -2,7 +2,7 @@ diff --git a/account_banking_pain_base/views/account_payment_order.xml b/account_banking_pain_base/views/account_payment_order.xml index 6c1e02900..59c886dab 100644 --- a/account_banking_pain_base/views/account_payment_order.xml +++ b/account_banking_pain_base/views/account_payment_order.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/bank_payment_line_view.xml b/account_banking_pain_base/views/bank_payment_line_view.xml index d6d05a9b3..5ed993f0e 100644 --- a/account_banking_pain_base/views/bank_payment_line_view.xml +++ b/account_banking_pain_base/views/bank_payment_line_view.xml @@ -1,7 +1,7 @@ diff --git a/account_banking_pain_base/views/res_config_settings.xml b/account_banking_pain_base/views/res_config_settings.xml new file mode 100644 index 000000000..a5942fb52 --- /dev/null +++ b/account_banking_pain_base/views/res_config_settings.xml @@ -0,0 +1,44 @@ + + + + + pain.group.on.account.config.settings + res.config.settings + + + +

SEPA/PAIN

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + +
diff --git a/setup/account_banking_pain_base/odoo/__init__.py b/setup/account_banking_pain_base/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_banking_pain_base/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_banking_pain_base/odoo/addons/__init__.py b/setup/account_banking_pain_base/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/account_banking_pain_base/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base b/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base new file mode 120000 index 000000000..41b3cc95f --- /dev/null +++ b/setup/account_banking_pain_base/odoo/addons/account_banking_pain_base @@ -0,0 +1 @@ +../../../../account_banking_pain_base \ No newline at end of file diff --git a/setup/account_banking_pain_base/setup.cfg b/setup/account_banking_pain_base/setup.cfg new file mode 100644 index 000000000..3c6e79cf3 --- /dev/null +++ b/setup/account_banking_pain_base/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup/account_banking_pain_base/setup.py b/setup/account_banking_pain_base/setup.py new file mode 100644 index 000000000..999b290c8 --- /dev/null +++ b/setup/account_banking_pain_base/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) \ No newline at end of file