From e1452cbb6b460bedf4c64e7442e7d74843995445 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 29 Jun 2016 17:50:32 +0200 Subject: [PATCH 01/28] Migrate to a new architecture with 3 modules for PAIN --- l10n_ch_pain_base/README.rst | 51 ++++++ l10n_ch_pain_base/__init__.py | 3 + l10n_ch_pain_base/__openerp__.py | 22 +++ l10n_ch_pain_base/i18n/en.po | 165 +++++++++++++++++ l10n_ch_pain_base/i18n/fr.po | 166 ++++++++++++++++++ l10n_ch_pain_base/i18n/it.po | 165 +++++++++++++++++ l10n_ch_pain_base/models/__init__.py | 5 + l10n_ch_pain_base/models/account_move_line.py | 19 ++ .../models/account_payment_line.py | 19 ++ .../models/account_payment_order.py | 107 +++++++++++ .../views/account_payment_line.xml | 19 ++ l10n_ch_pain_base/views/bank_payment_line.xml | 21 +++ 12 files changed, 762 insertions(+) create mode 100644 l10n_ch_pain_base/README.rst create mode 100644 l10n_ch_pain_base/__init__.py create mode 100644 l10n_ch_pain_base/__openerp__.py create mode 100644 l10n_ch_pain_base/i18n/en.po create mode 100644 l10n_ch_pain_base/i18n/fr.po create mode 100644 l10n_ch_pain_base/i18n/it.po create mode 100644 l10n_ch_pain_base/models/__init__.py create mode 100644 l10n_ch_pain_base/models/account_move_line.py create mode 100644 l10n_ch_pain_base/models/account_payment_line.py create mode 100644 l10n_ch_pain_base/models/account_payment_order.py create mode 100644 l10n_ch_pain_base/views/account_payment_line.xml create mode 100644 l10n_ch_pain_base/views/bank_payment_line.xml diff --git a/l10n_ch_pain_base/README.rst b/l10n_ch_pain_base/README.rst new file mode 100644 index 000000000..7942f9e71 --- /dev/null +++ b/l10n_ch_pain_base/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=================================== +Switzerland - ISO 20022 base module +=================================== + +This module doesn't do anything by himself. It is the base module for 2 other modules: + +* the module *l10n_ch_pain_credit_transfer* which adds support for the file format *pain.001.001.03.ch.02* which is used for ISO 20022 credit transfers (SEPA or not SEPA), + +* the module *l10n_ch_pain_direct_debit* which adds support for the file format *pain.008.001.02.ch.01* which is used for ISO 20022 direct debits. + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/125/9.0 + +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. + +Credits +======= + +Contributors +------------ + +* Alexis de Lattre + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/l10n_ch_pain_base/__init__.py b/l10n_ch_pain_base/__init__.py new file mode 100644 index 000000000..cde864bae --- /dev/null +++ b/l10n_ch_pain_base/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/l10n_ch_pain_base/__openerp__.py b/l10n_ch_pain_base/__openerp__.py new file mode 100644 index 000000000..57f608f70 --- /dev/null +++ b/l10n_ch_pain_base/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# © 2011 Camptocamp SA (Yannick Vaucher) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Switzerland - ISO 20022", + "summary": "ISO 20022 base module for Switzerland", + "version": "9.0.1.0.1", + "category": "Finance", + "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "account_banking_pain_base", + "l10n_ch_base_bank", + ], + "data": [ + 'views/account_payment_line.xml', + 'views/bank_payment_line.xml', + ], + 'installable': True, +} diff --git a/l10n_ch_pain_base/i18n/en.po b/l10n_ch_pain_base/i18n/en.po new file mode 100644 index 000000000..4b6dc54d6 --- /dev/null +++ b/l10n_ch_pain_base/i18n/en.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_sepa +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: l10n-switzerland (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-17 12:24+0000\n" +"PO-Revision-Date: 2015-06-17 13:34+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 +#, python-format +msgid "A payment order is missing" +msgstr "A payment order is missing" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Close" +msgstr "Close" + +#. module: l10n_ch_sepa +#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 +msgid "Create SEPA payment" +msgstr "Create SEPA payment" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_uid:0 +msgid "Created by" +msgstr "Created by" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_date:0 +msgid "Created on" +msgstr "Created on" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 +#, python-format +msgid "ErrorCompanyBank No company bank is defined in payment" +msgstr "ErrorCompanyBank No company bank is defined in payment" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 +#, python-format +msgid "" +"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " +"Account number" +msgstr "ErrorCompanyBankAccNumber The selected company bank has no IBAN and no Account number" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 +#, python-format +msgid "" +"ErrorCompanyBankBIC The selected company bank account has no BIC number" +msgstr "ErrorCompanyBankBIC The selected company bank account has no BIC number" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 +#, python-format +msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" +msgstr "ErrorCreditorBank No bank selected for creditor of invoice %s" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 +#, python-format +msgid "" +"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" +msgstr "ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 +#, python-format +msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." +msgstr "ErrorPaymentState: Payment is in draft state. Please confirm it first." + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Generate File" +msgstr "Generate File" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,id:0 +msgid "ID" +msgstr "ID" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_uid:0 +msgid "Last Updated by" +msgstr "Last Updated by" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_date:0 +msgid "Last Updated on" +msgstr "Last Updated on" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#, python-format +msgid "No XML data found" +msgstr "No XML data found" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "No XSD file found" +msgstr "No XSD file found" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 +#, python-format +msgid "No data has been entered" +msgstr "No data has been entered" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "SEPA Payment File" +msgstr "SEPA Payment File" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 +#, python-format +msgid "" +"The document validation has raised following errors: \n" +"%s" +msgstr "The document validation has raised following errors: \n%s" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,pain_001_file:0 +msgid "XML File" +msgstr "XML File" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 +#, python-format +msgid "XML is Empty ! An error has occured during XML generation" +msgstr "XML is Empty ! An error has occured during XML generation" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 +#, python-format +msgid "XML is not Valid !" +msgstr "XML is not Valid !" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "pain.001 file creation" +msgstr "pain.001 file creation" diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po new file mode 100644 index 000000000..dbed05ab2 --- /dev/null +++ b/l10n_ch_pain_base/i18n/fr.po @@ -0,0 +1,166 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_sepa +# +# Translators: +# Yannick Vaucher , 2015 +msgid "" +msgstr "" +"Project-Id-Version: l10n-switzerland (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-09 14:46+0000\n" +"PO-Revision-Date: 2015-10-06 13:28+0000\n" +"Last-Translator: Yannick Vaucher \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 +#, python-format +msgid "A payment order is missing" +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Close" +msgstr "Fermer" + +#. module: l10n_ch_sepa +#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 +msgid "Create SEPA payment" +msgstr "Créer un paiement SEPA" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_uid:0 +msgid "Created by" +msgstr "Créé par" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_date:0 +msgid "Created on" +msgstr "Créé le" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "Error" +msgstr "Erreur" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 +#, python-format +msgid "ErrorCompanyBank No company bank is defined in payment" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 +#, python-format +msgid "" +"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " +"Account number" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 +#, python-format +msgid "" +"ErrorCompanyBankBIC The selected company bank account has no BIC number" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 +#, python-format +msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 +#, python-format +msgid "" +"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 +#, python-format +msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Generate File" +msgstr "" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,id:0 +msgid "ID" +msgstr "ID" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_uid:0 +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_date:0 +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#, python-format +msgid "No XML data found" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "No XSD file found" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 +#, python-format +msgid "No data has been entered" +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "SEPA Payment File" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 +#, python-format +msgid "" +"The document validation has raised following errors: \n" +"%s" +msgstr "" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,pain_001_file:0 +msgid "XML File" +msgstr "Fichier XML" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 +#, python-format +msgid "XML is Empty ! An error has occured during XML generation" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 +#, python-format +msgid "XML is not Valid !" +msgstr "XML non valide !" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "pain.001 file creation" +msgstr "création du fichier pain.001" diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po new file mode 100644 index 000000000..3d1a6c032 --- /dev/null +++ b/l10n_ch_pain_base/i18n/it.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_sepa +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: l10n-switzerland (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-17 12:24+0000\n" +"PO-Revision-Date: 2015-06-17 13:34+0000\n" +"Last-Translator: <>\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 +#, python-format +msgid "A payment order is missing" +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Close" +msgstr "" + +#. module: l10n_ch_sepa +#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 +msgid "Create SEPA payment" +msgstr "" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_uid:0 +msgid "Created by" +msgstr "Created by" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,create_date:0 +msgid "Created on" +msgstr "Created on" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "Error" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 +#, python-format +msgid "ErrorCompanyBank No company bank is defined in payment" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 +#, python-format +msgid "" +"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " +"Account number" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 +#, python-format +msgid "" +"ErrorCompanyBankBIC The selected company bank account has no BIC number" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 +#, python-format +msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 +#, python-format +msgid "" +"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 +#, python-format +msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "Generate File" +msgstr "" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,id:0 +msgid "ID" +msgstr "ID" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_uid:0 +msgid "Last Updated by" +msgstr "Last Updated by" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,write_date:0 +msgid "Last Updated on" +msgstr "Last Updated on" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 +#, python-format +msgid "No XML data found" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 +#, python-format +msgid "No XSD file found" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 +#, python-format +msgid "No data has been entered" +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "SEPA Payment File" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 +#, python-format +msgid "" +"The document validation has raised following errors: \n" +"%s" +msgstr "" + +#. module: l10n_ch_sepa +#: field:wizard.pain001,pain_001_file:0 +msgid "XML File" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 +#, python-format +msgid "XML is Empty ! An error has occured during XML generation" +msgstr "" + +#. module: l10n_ch_sepa +#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 +#, python-format +msgid "XML is not Valid !" +msgstr "" + +#. module: l10n_ch_sepa +#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view +msgid "pain.001 file creation" +msgstr "" diff --git a/l10n_ch_pain_base/models/__init__.py b/l10n_ch_pain_base/models/__init__.py new file mode 100644 index 000000000..d8e4be034 --- /dev/null +++ b/l10n_ch_pain_base/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import account_payment_order +from . import account_payment_line +from . import account_move_line diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py new file mode 100644 index 000000000..c40f32298 --- /dev/null +++ b/l10n_ch_pain_base/models/account_move_line.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, api + + +class AccountMoveLine(models.Model): + _inherit = 'account.move.line' + + @api.multi + def _prepare_payment_line_vals(self, payment_order): + vals = super(AccountMoveLine, self)._prepare_payment_line_vals( + payment_order) + if self.invoice_id and self.invoice_id.reference_type == 'bvr': + vals['local_instrument'] = 'CH01' + if vals['communication']: + vals['communication'] = vals['communication'].replace(' ', '') + return vals diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py new file mode 100644 index 000000000..77797da26 --- /dev/null +++ b/l10n_ch_pain_base/models/account_payment_line.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 + + +class AccountPaymentLine(models.Model): + _inherit = 'account.payment.line' + + local_instrument = fields.Selection( + selection_add=[('CH01', 'CH01 (BVR)')]) + communication_type = fields.Selection(selection_add=[('bvr', 'BVR')]) + + def invoice_reference_type2communication_type(self): + res = super(AccountPaymentLine, self).\ + invoice_reference_type2communication_type() + res['bvr'] = 'bvr' + return res diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py new file mode 100644 index 000000000..94b3b6d19 --- /dev/null +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (www.akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, api, _ +from openerp.exceptions import UserError +from lxml import etree + + +class AccountPaymentOrder(models.Model): + _inherit = 'account.payment.order' + + @api.multi + def compute_sepa_final_hook(self, sepa): + self.ensure_one() + sepa = super(AccountPaymentOrder, self).compute_sepa_final_hook(sepa) + # BVR orders cannot be SEPA orders + if sepa and any( + line.communication_type == 'bvr' + for line in self.payment_line_ids): + sepa = False + return sepa + + @api.multi + def generate_pain_nsmap(self): + self.ensure_one() + nsmap = super(AccountPaymentOrder, self).generate_pain_nsmap() + pain_flavor = self.payment_mode_id.payment_method_id.pain_version + if pain_flavor in ['pain.001.001.03.ch.02', 'pain.008.001.02.ch.01']: + nsmap[None] = 'http://www.six-interbank-clearing.com/de/'\ + '%s.xsd' % pain_flavor + + return nsmap + + @api.multi + def generate_pain_attrib(self): + self.ensure_one() + pain_flavor = self.payment_mode_id.payment_method_id.pain_version + if pain_flavor in ['pain.001.001.03.ch.02', 'pain.008.001.02.ch.01']: + attrib = { + "{http://www.w3.org/2001/XMLSchema-instance}schemaLocation": + "http://www.six-interbank-clearing.com/de/" + "%s.xsd %s.xsd" % (pain_flavor, pain_flavor) + } + return attrib + else: + return super(AccountPaymentOrder, self).generate_pain_attrib() + + @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): + if gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02': + gen_args['local_instrument_type'] = 'proprietary' + gen_args['structured_remittance_issuer'] = False + return super(AccountPaymentOrder, self).\ + generate_start_payment_info_block( + parent_node, payment_info_ident, priority, local_instrument, + sequence_type, requested_date, eval_ctx, gen_args) + + @api.model + def generate_party_agent( + self, parent_node, party_type, order, partner_bank, gen_args, + bank_line=None): + if ( + gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and + bank_line): + if bank_line.local_instrument == 'CH01': + # Don't set the creditor agent on BVR/CH01 payments + return True + elif not partner_bank.bank_bic: + raise UserError(_( + "For pain.001.001.03.ch.02, for non-BVR payments, " + "the BIC is required on the bank '%s' related to the " + "bank account '%s'") % ( + partner_bank.bank_id.name, + partner_bank.acc_number)) + return super(AccountPaymentOrder, self).generate_party_agent( + parent_node, party_type, order, partner_bank, gen_args, + bank_line=bank_line) + + @api.model + def generate_party_acc_number( + self, parent_node, party_type, order, partner_bank, gen_args, + bank_line=None): + if ( + gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and + bank_line and + bank_line.local_instrument == 'CH01'): + if not partner_bank.ccp: + raise UserError(_( + "The field 'CCP/CP-Konto' is not set on the bank " + "'%s'.") % partner_bank.bank_id.name) + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + 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.ccp + return True + else: + return super(AccountPaymentOrder, self).generate_party_acc_number( + parent_node, party_type, order, partner_bank, gen_args, + bank_line=bank_line) diff --git a/l10n_ch_pain_base/views/account_payment_line.xml b/l10n_ch_pain_base/views/account_payment_line.xml new file mode 100644 index 000000000..ae36843b8 --- /dev/null +++ b/l10n_ch_pain_base/views/account_payment_line.xml @@ -0,0 +1,19 @@ + + + + + + l10n_ch_sepa.account.payment.line + account.payment.line + + + + 0 + + + + + diff --git a/l10n_ch_pain_base/views/bank_payment_line.xml b/l10n_ch_pain_base/views/bank_payment_line.xml new file mode 100644 index 000000000..7e287803d --- /dev/null +++ b/l10n_ch_pain_base/views/bank_payment_line.xml @@ -0,0 +1,21 @@ + + + + + + + l10n_ch_sepa.bank.payment.line.form + bank.payment.line + + + + 0 + + + + + + From 66cb8c842b3dfaa2543cd18a27d8a398f10d7205 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 29 Jun 2016 18:41:34 +0200 Subject: [PATCH 02/28] Add a unit-test for payment type 3 Fix sepa compute method --- l10n_ch_pain_base/models/account_payment_order.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 94b3b6d19..ecfe820d5 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -14,10 +14,9 @@ class AccountPaymentOrder(models.Model): def compute_sepa_final_hook(self, sepa): self.ensure_one() sepa = super(AccountPaymentOrder, self).compute_sepa_final_hook(sepa) + pain_flavor = self.payment_mode_id.payment_method_id.pain_version # BVR orders cannot be SEPA orders - if sepa and any( - line.communication_type == 'bvr' - for line in self.payment_line_ids): + if pain_flavor and '.ch.' in pain_flavor: sepa = False return sepa From 9ef545f06fcef5ab64827100b9e1faabbcf2c389 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:56:38 +0200 Subject: [PATCH 03/28] [MIG] Make modules uninstallable --- l10n_ch_pain_base/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/__openerp__.py b/l10n_ch_pain_base/__openerp__.py index 57f608f70..771c20fff 100644 --- a/l10n_ch_pain_base/__openerp__.py +++ b/l10n_ch_pain_base/__openerp__.py @@ -18,5 +18,5 @@ 'views/account_payment_line.xml', 'views/bank_payment_line.xml', ], - 'installable': True, + 'installable': False, } From e364cdf465a90ee8162ff4a278b16a916ed67681 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:56:43 +0200 Subject: [PATCH 04/28] [MIG] Rename manifest files --- l10n_ch_pain_base/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename l10n_ch_pain_base/{__openerp__.py => __manifest__.py} (100%) diff --git a/l10n_ch_pain_base/__openerp__.py b/l10n_ch_pain_base/__manifest__.py similarity index 100% rename from l10n_ch_pain_base/__openerp__.py rename to l10n_ch_pain_base/__manifest__.py From 7af5eafb61ae7966d3f0ccaefe356c3a51d19955 Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Tue, 28 Feb 2017 18:15:43 +0100 Subject: [PATCH 05/28] [MIG] l10n_ch_pain_base: Migrated to 10.0 --- l10n_ch_pain_base/README.rst | 1 + l10n_ch_pain_base/__manifest__.py | 10 +++++----- l10n_ch_pain_base/models/account_move_line.py | 4 ++-- .../models/account_payment_line.py | 4 ++-- .../models/account_payment_order.py | 6 +++--- .../views/account_payment_line.xml | 18 ++++++++--------- l10n_ch_pain_base/views/bank_payment_line.xml | 20 +++++++++---------- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/l10n_ch_pain_base/README.rst b/l10n_ch_pain_base/README.rst index 7942f9e71..52640d535 100644 --- a/l10n_ch_pain_base/README.rst +++ b/l10n_ch_pain_base/README.rst @@ -34,6 +34,7 @@ Contributors ------------ * Alexis de Lattre +* Denis Leemann Maintainer ---------- diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 771c20fff..c517ed7ce 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (Alexis de Lattre ) -# © 2011 Camptocamp SA (Yannick Vaucher) +# copyright 2016 Akretion (Alexis de Lattre ) +# copyright 2011 Camptocamp SA (Yannick Vaucher) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "9.0.1.0.1", + "version": "10.0.1.0.0", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", @@ -17,6 +17,6 @@ "data": [ 'views/account_payment_line.xml', 'views/bank_payment_line.xml', - ], - 'installable': False, + ], + 'installable': True, } diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index c40f32298..03b4ff2c7 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (Alexis de Lattre ) +# copyright 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api +from odoo import models, api class AccountMoveLine(models.Model): diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index 77797da26..dba28c738 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion - Alexis de Lattre +# copyright 2016 Akretion - Alexis de Lattre # 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/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index ecfe820d5..23d99fe29 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# © 2016 Akretion (www.akretion.com) +# copyright 2016 Akretion (www.akretion.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api, _ -from openerp.exceptions import UserError +from odoo import models, api, _ +from odoo.exceptions import UserError from lxml import etree diff --git a/l10n_ch_pain_base/views/account_payment_line.xml b/l10n_ch_pain_base/views/account_payment_line.xml index ae36843b8..14fa141b0 100644 --- a/l10n_ch_pain_base/views/account_payment_line.xml +++ b/l10n_ch_pain_base/views/account_payment_line.xml @@ -5,15 +5,15 @@ --> - - l10n_ch_sepa.account.payment.line - account.payment.line - - - - 0 + + l10n_ch_sepa.account.payment.line + account.payment.line + + + + 0 + - - + diff --git a/l10n_ch_pain_base/views/bank_payment_line.xml b/l10n_ch_pain_base/views/bank_payment_line.xml index 7e287803d..603a3aaeb 100644 --- a/l10n_ch_pain_base/views/bank_payment_line.xml +++ b/l10n_ch_pain_base/views/bank_payment_line.xml @@ -4,18 +4,16 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - - l10n_ch_sepa.bank.payment.line.form - bank.payment.line - - - - 0 + + l10n_ch_sepa.bank.payment.line.form + bank.payment.line + + + + 0 + - - + - From e722a4b0b20f1543716e634cb77565b4c5c96ce7 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Thu, 16 Mar 2017 11:23:33 +0100 Subject: [PATCH 06/28] Adapt tests to editable ccp on partner bank form --- l10n_ch_pain_base/models/account_payment_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 23d99fe29..91fbe6665 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -90,7 +90,7 @@ def generate_party_acc_number( if not partner_bank.ccp: raise UserError(_( "The field 'CCP/CP-Konto' is not set on the bank " - "'%s'.") % partner_bank.bank_id.name) + "account '%s'.") % partner_bank.name) party_account = etree.SubElement( parent_node, '%sAcct' % party_type) party_account_id = etree.SubElement(party_account, 'Id') From 4a52979a2e8c450bdbd00dd7350e86e009a7f1c1 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 20 Jun 2017 16:50:04 +0200 Subject: [PATCH 07/28] Fix pain base following change of method signature in oca/bank-payment#366 --- l10n_ch_pain_base/__manifest__.py | 2 +- l10n_ch_pain_base/i18n/de.po | 48 +++++ l10n_ch_pain_base/i18n/en.po | 178 +++--------------- l10n_ch_pain_base/i18n/fr.po | 173 +++-------------- l10n_ch_pain_base/i18n/it.po | 165 +++------------- l10n_ch_pain_base/i18n/nb_NO.po | 48 +++++ .../models/account_payment_order.py | 7 +- 7 files changed, 184 insertions(+), 437 deletions(-) create mode 100644 l10n_ch_pain_base/i18n/de.po create mode 100644 l10n_ch_pain_base/i18n/nb_NO.po diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index c517ed7ce..9b5dd4c59 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "10.0.1.0.0", + "version": "10.0.1.0.1", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po new file mode 100644 index 000000000..f6c534b3d --- /dev/null +++ b/l10n_ch_pain_base/i18n/de.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_pain_base +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-19 00:40+0000\n" +"PO-Revision-Date: 2017-04-19 00:40+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/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: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 +#, python-format +msgid "" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" +msgstr "Journalbuchung" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 +#, python-format +msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +msgstr "" diff --git a/l10n_ch_pain_base/i18n/en.po b/l10n_ch_pain_base/i18n/en.po index 4b6dc54d6..0fe3a94ae 100644 --- a/l10n_ch_pain_base/i18n/en.po +++ b/l10n_ch_pain_base/i18n/en.po @@ -1,165 +1,47 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_ch_sepa +# * l10n_ch_pain_base # -# Translators: msgid "" msgstr "" -"Project-Id-Version: l10n-switzerland (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-17 12:24+0000\n" -"PO-Revision-Date: 2015-06-17 13:34+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/en/)\n" +"POT-Creation-Date: 2016-07-02 02:47+0000\n" +"PO-Revision-Date: 2016-07-02 02:47+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" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: \n" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 -#, python-format -msgid "A payment order is missing" -msgstr "A payment order is missing" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Close" -msgstr "Close" - -#. module: l10n_ch_sepa -#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 -msgid "Create SEPA payment" -msgstr "Create SEPA payment" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_uid:0 -msgid "Created by" -msgstr "Created by" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_date:0 -msgid "Created on" -msgstr "Created on" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "Error" -msgstr "Error" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 -#, python-format -msgid "ErrorCompanyBank No company bank is defined in payment" -msgstr "ErrorCompanyBank No company bank is defined in payment" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 -#, python-format -msgid "" -"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " -"Account number" -msgstr "ErrorCompanyBankAccNumber The selected company bank has no IBAN and no Account number" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 -#, python-format -msgid "" -"ErrorCompanyBankBIC The selected company bank account has no BIC number" -msgstr "ErrorCompanyBankBIC The selected company bank account has no BIC number" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 -#, python-format -msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" -msgstr "ErrorCreditorBank No bank selected for creditor of invoice %s" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format msgid "" -"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" -msgstr "ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 -#, python-format -msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." -msgstr "ErrorPaymentState: Payment is in draft state. Please confirm it first." - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Generate File" -msgstr "Generate File" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,id:0 -msgid "ID" -msgstr "ID" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_uid:0 -msgid "Last Updated by" -msgstr "Last Updated by" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_date:0 -msgid "Last Updated on" -msgstr "Last Updated on" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#, python-format -msgid "No XML data found" -msgstr "No XML data found" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "No XSD file found" -msgstr "No XSD file found" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" +msgstr "" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 -#, python-format -msgid "No data has been entered" -msgstr "No data has been entered" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" +msgstr "Journal Item" -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "SEPA Payment File" -msgstr "SEPA Payment File" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Payment Lines" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 -#, python-format -msgid "" -"The document validation has raised following errors: \n" -"%s" -msgstr "The document validation has raised following errors: \n%s" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Payment Order" -#. module: l10n_ch_sepa -#: field:wizard.pain001,pain_001_file:0 -msgid "XML File" -msgstr "XML File" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 -#, python-format -msgid "XML is Empty ! An error has occured during XML generation" -msgstr "XML is Empty ! An error has occured during XML generation" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 #, python-format -msgid "XML is not Valid !" -msgstr "XML is not Valid !" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "pain.001 file creation" -msgstr "pain.001 file creation" +msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." +msgstr "The field 'CCP/CP-Konto' is not set on the bank '%s'." diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po index dbed05ab2..95508e430 100644 --- a/l10n_ch_pain_base/i18n/fr.po +++ b/l10n_ch_pain_base/i18n/fr.po @@ -1,166 +1,51 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_ch_sepa +# * l10n_ch_pain_base # # Translators: -# Yannick Vaucher , 2015 +# leemannd , 2017 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: l10n-switzerland (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-09 14:46+0000\n" -"PO-Revision-Date: 2015-10-06 13:28+0000\n" -"Last-Translator: Yannick Vaucher \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/fr/)\n" +"POT-Creation-Date: 2017-12-01 03:54+0000\n" +"PO-Revision-Date: 2017-12-01 03:54+0000\n" +"Last-Translator: OCA Transbot , 2017\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: \n" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 -#, python-format -msgid "A payment order is missing" -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Close" -msgstr "Fermer" - -#. module: l10n_ch_sepa -#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 -msgid "Create SEPA payment" -msgstr "Créer un paiement SEPA" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_uid:0 -msgid "Created by" -msgstr "Créé par" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_date:0 -msgid "Created on" -msgstr "Créé le" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "Error" -msgstr "Erreur" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 -#, python-format -msgid "ErrorCompanyBank No company bank is defined in payment" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:73 #, python-format msgid "" -"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " -"Account number" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" msgstr "" +"Pour pain.001.001.03.ch.02 et les payement non-BVR, le BIC est requis sur " +"les Banques '%s' lié au compte bancaire '%s'" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 -#, python-format -msgid "" -"ErrorCompanyBankBIC The selected company bank account has no BIC number" -msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" +msgstr "Écriture comptable" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 -#, python-format -msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" -msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Lignes de Paiement" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 -#, python-format -msgid "" -"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" -msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Ordre de paiement" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:92 #, python-format -msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Generate File" +msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." msgstr "" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,id:0 -msgid "ID" -msgstr "ID" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_uid:0 -msgid "Last Updated by" -msgstr "Dernière mise à jour par" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_date:0 -msgid "Last Updated on" -msgstr "Dernière mise à jour le" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#, python-format -msgid "No XML data found" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "No XSD file found" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 -#, python-format -msgid "No data has been entered" -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "SEPA Payment File" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 -#, python-format -msgid "" -"The document validation has raised following errors: \n" -"%s" -msgstr "" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,pain_001_file:0 -msgid "XML File" -msgstr "Fichier XML" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 -#, python-format -msgid "XML is Empty ! An error has occured during XML generation" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 -#, python-format -msgid "XML is not Valid !" -msgstr "XML non valide !" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "pain.001 file creation" -msgstr "création du fichier pain.001" diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index 3d1a6c032..51dceaf9c 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -1,165 +1,48 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_ch_sepa +# * l10n_ch_pain_base # # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: l10n-switzerland (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-17 12:24+0000\n" -"PO-Revision-Date: 2015-06-17 13:34+0000\n" -"Last-Translator: <>\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-l10n-switzerland-8-0/language/it/)\n" +"POT-Creation-Date: 2017-03-03 03:39+0000\n" +"PO-Revision-Date: 2017-03-03 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:74 -#, python-format -msgid "A payment order is missing" -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Close" -msgstr "" - -#. module: l10n_ch_sepa -#: model:ir.actions.act_window,name:l10n_ch_sepa.action_create_pain_001 -msgid "Create SEPA payment" -msgstr "" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_uid:0 -msgid "Created by" -msgstr "Created by" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,create_date:0 -msgid "Created on" -msgstr "Created on" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "Error" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:85 -#, python-format -msgid "ErrorCompanyBank No company bank is defined in payment" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:94 -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:114 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format msgid "" -"ErrorCompanyBankAccNumber The selected company bank has no IBAN and no " -"Account number" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" msgstr "" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:89 -#, python-format -msgid "" -"ErrorCompanyBankBIC The selected company bank account has no BIC number" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" msgstr "" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:103 -#, python-format -msgid "ErrorCreditorBank No bank selected for creditor of invoice %s" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" msgstr "" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:108 -#, python-format -msgid "" -"ErrorCreditorBankBIC Creditor bank account has no BIC number for invoice %s" -msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Ordine di Pagamento" -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:79 +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 #, python-format -msgid "ErrorPaymentState: Payment is in draft state. Please confirm it first." -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "Generate File" -msgstr "" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,id:0 -msgid "ID" -msgstr "ID" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_uid:0 -msgid "Last Updated by" -msgstr "Last Updated by" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,write_date:0 -msgid "Last Updated on" -msgstr "Last Updated on" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:50 -#, python-format -msgid "No XML data found" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:55 -#, python-format -msgid "No XSD file found" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:70 -#, python-format -msgid "No data has been entered" -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "SEPA Payment File" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:69 -#, python-format -msgid "" -"The document validation has raised following errors: \n" -"%s" -msgstr "" - -#. module: l10n_ch_sepa -#: field:wizard.pain001,pain_001_file:0 -msgid "XML File" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/pain_001.py:152 -#, python-format -msgid "XML is Empty ! An error has occured during XML generation" -msgstr "" - -#. module: l10n_ch_sepa -#: code:addons/l10n_ch_sepa/base_sepa/msg_sepa.py:68 -#, python-format -msgid "XML is not Valid !" -msgstr "" - -#. module: l10n_ch_sepa -#: view:wizard.pain001:l10n_ch_sepa.wizard_pain_001_view -msgid "pain.001 file creation" +msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." msgstr "" diff --git a/l10n_ch_pain_base/i18n/nb_NO.po b/l10n_ch_pain_base/i18n/nb_NO.po new file mode 100644 index 000000000..d9f5ff514 --- /dev/null +++ b/l10n_ch_pain_base/i18n/nb_NO.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_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-31 03:43+0000\n" +"PO-Revision-Date: 2016-07-31 03:43+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: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 +#, python-format +msgid "" +"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"bank '%s' related to the bank account '%s'" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" +msgstr "Journalgjenstand" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "Betalingslinjer" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "Betalingsordre" + +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 +#, python-format +msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." +msgstr "" diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 91fbe6665..428703c76 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -48,15 +48,16 @@ def generate_pain_attrib(self): @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): if gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02': gen_args['local_instrument_type'] = 'proprietary' gen_args['structured_remittance_issuer'] = False return super(AccountPaymentOrder, self).\ generate_start_payment_info_block( parent_node, payment_info_ident, priority, local_instrument, - sequence_type, requested_date, eval_ctx, gen_args) + category_purpose, sequence_type, requested_date, eval_ctx, + gen_args) @api.model def generate_party_agent( From 9ef01465130392d4d466f7552bfb93441c180576 Mon Sep 17 00:00:00 2001 From: mpanarin Date: Thu, 4 Jan 2018 18:25:33 +0200 Subject: [PATCH 08/28] [MIG] l10n_ch_pain_base: Migrate to odoo 11 --- l10n_ch_pain_base/README.rst | 3 +- l10n_ch_pain_base/__init__.py | 2 - l10n_ch_pain_base/__manifest__.py | 3 +- l10n_ch_pain_base/i18n/en.po | 47 ------------------ l10n_ch_pain_base/i18n/nb_NO.po | 48 ------------------- .../migrations/11.0.1.0.0/post-migration.py | 16 +++++++ l10n_ch_pain_base/models/__init__.py | 2 - l10n_ch_pain_base/models/account_move_line.py | 3 +- .../models/account_payment_line.py | 7 ++- .../models/account_payment_order.py | 38 +++++++-------- 10 files changed, 41 insertions(+), 128 deletions(-) delete mode 100644 l10n_ch_pain_base/i18n/en.po delete mode 100644 l10n_ch_pain_base/i18n/nb_NO.po create mode 100644 l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py diff --git a/l10n_ch_pain_base/README.rst b/l10n_ch_pain_base/README.rst index 52640d535..eac70b73f 100644 --- a/l10n_ch_pain_base/README.rst +++ b/l10n_ch_pain_base/README.rst @@ -17,7 +17,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/125/9.0 + :target: https://runbot.odoo-community.org/runbot/125/11.0 Bug Tracker =========== @@ -35,6 +35,7 @@ Contributors * Alexis de Lattre * Denis Leemann +* Mykhailo Panarin Maintainer ---------- diff --git a/l10n_ch_pain_base/__init__.py b/l10n_ch_pain_base/__init__.py index cde864bae..0650744f6 100644 --- a/l10n_ch_pain_base/__init__.py +++ b/l10n_ch_pain_base/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import models diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 9b5dd4c59..07de7a69a 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Akretion (Alexis de Lattre ) # copyright 2011 Camptocamp SA (Yannick Vaucher) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "10.0.1.0.1", + "version": "11.0.1.0.0", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/l10n_ch_pain_base/i18n/en.po b/l10n_ch_pain_base/i18n/en.po deleted file mode 100644 index 0fe3a94ae..000000000 --- a/l10n_ch_pain_base/i18n/en.po +++ /dev/null @@ -1,47 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_ch_pain_base -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-02 02:47+0000\n" -"PO-Revision-Date: 2016-07-02 02:47+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: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 -#, python-format -msgid "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " -"bank '%s' related to the bank account '%s'" -msgstr "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " -"bank '%s' related to the bank account '%s'" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line -msgid "Journal Item" -msgstr "Journal Item" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line -msgid "Payment Lines" -msgstr "Payment Lines" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order -msgid "Payment Order" -msgstr "Payment Order" - -#. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 -#, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." -msgstr "The field 'CCP/CP-Konto' is not set on the bank '%s'." diff --git a/l10n_ch_pain_base/i18n/nb_NO.po b/l10n_ch_pain_base/i18n/nb_NO.po deleted file mode 100644 index d9f5ff514..000000000 --- a/l10n_ch_pain_base/i18n/nb_NO.po +++ /dev/null @@ -1,48 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_ch_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-31 03:43+0000\n" -"PO-Revision-Date: 2016-07-31 03:43+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: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 -#, python-format -msgid "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " -"bank '%s' related to the bank account '%s'" -msgstr "" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line -msgid "Journal Item" -msgstr "Journalgjenstand" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line -msgid "Payment Lines" -msgstr "Betalingslinjer" - -#. module: l10n_ch_pain_base -#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order -msgid "Payment Order" -msgstr "Betalingsordre" - -#. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 -#, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." -msgstr "" diff --git a/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py b/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py new file mode 100644 index 000000000..90f97a314 --- /dev/null +++ b/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py @@ -0,0 +1,16 @@ +# Copyright 2018 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def reference_type_bvr_to_isr(cr): + """Change BVR to ISR in reference_type field""" + cr.execute(""" + UPDATE account_invoice SET communication_type='isr' + WHERE communication_type = 'bvr'; + """) + + +@openupgrade.migrate() +def migrate(env, version): + reference_type_bvr_to_isr(env.cr) diff --git a/l10n_ch_pain_base/models/__init__.py b/l10n_ch_pain_base/models/__init__.py index d8e4be034..065d5b2d3 100644 --- a/l10n_ch_pain_base/models/__init__.py +++ b/l10n_ch_pain_base/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import account_payment_order from . import account_payment_line from . import account_move_line diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 03b4ff2c7..bfed64a18 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -12,7 +11,7 @@ class AccountMoveLine(models.Model): def _prepare_payment_line_vals(self, payment_order): vals = super(AccountMoveLine, self)._prepare_payment_line_vals( payment_order) - if self.invoice_id and self.invoice_id.reference_type == 'bvr': + if self.invoice_id and self.invoice_id.reference_type == 'isr': vals['local_instrument'] = 'CH01' if vals['communication']: vals['communication'] = vals['communication'].replace(' ', '') diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index dba28c738..a5c8a028e 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -9,11 +8,11 @@ class AccountPaymentLine(models.Model): _inherit = 'account.payment.line' local_instrument = fields.Selection( - selection_add=[('CH01', 'CH01 (BVR)')]) - communication_type = fields.Selection(selection_add=[('bvr', 'BVR')]) + selection_add=[('CH01', 'CH01 (ISR)')]) + communication_type = fields.Selection(selection_add=[('isr', 'ISR')]) def invoice_reference_type2communication_type(self): res = super(AccountPaymentLine, self).\ invoice_reference_type2communication_type() - res['bvr'] = 'bvr' + res['isr'] = 'isr' return res diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 428703c76..545b1e610 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # copyright 2016 Akretion (www.akretion.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -13,9 +12,9 @@ class AccountPaymentOrder(models.Model): @api.multi def compute_sepa_final_hook(self, sepa): self.ensure_one() - sepa = super(AccountPaymentOrder, self).compute_sepa_final_hook(sepa) + sepa = super().compute_sepa_final_hook(sepa) pain_flavor = self.payment_mode_id.payment_method_id.pain_version - # BVR orders cannot be SEPA orders + # ISR orders cannot be SEPA orders if pain_flavor and '.ch.' in pain_flavor: sepa = False return sepa @@ -23,7 +22,7 @@ def compute_sepa_final_hook(self, sepa): @api.multi def generate_pain_nsmap(self): self.ensure_one() - nsmap = super(AccountPaymentOrder, self).generate_pain_nsmap() + nsmap = super().generate_pain_nsmap() pain_flavor = self.payment_mode_id.payment_method_id.pain_version if pain_flavor in ['pain.001.001.03.ch.02', 'pain.008.001.02.ch.01']: nsmap[None] = 'http://www.six-interbank-clearing.com/de/'\ @@ -43,7 +42,7 @@ def generate_pain_attrib(self): } return attrib else: - return super(AccountPaymentOrder, self).generate_pain_attrib() + return super().generate_pain_attrib() @api.model def generate_start_payment_info_block( @@ -53,11 +52,11 @@ def generate_start_payment_info_block( if gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02': gen_args['local_instrument_type'] = 'proprietary' gen_args['structured_remittance_issuer'] = False - return super(AccountPaymentOrder, self).\ - generate_start_payment_info_block( - parent_node, payment_info_ident, priority, local_instrument, - category_purpose, sequence_type, requested_date, eval_ctx, - gen_args) + return super().generate_start_payment_info_block( + parent_node, payment_info_ident, priority, local_instrument, + category_purpose, sequence_type, requested_date, eval_ctx, + gen_args, + ) @api.model def generate_party_agent( @@ -67,25 +66,24 @@ def generate_party_agent( gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and bank_line): if bank_line.local_instrument == 'CH01': - # Don't set the creditor agent on BVR/CH01 payments + # Don't set the creditor agent on ISR/CH01 payments return True elif not partner_bank.bank_bic: raise UserError(_( - "For pain.001.001.03.ch.02, for non-BVR payments, " + "For pain.001.001.03.ch.02, for non-ISR payments, " "the BIC is required on the bank '%s' related to the " "bank account '%s'") % ( partner_bank.bank_id.name, partner_bank.acc_number)) - return super(AccountPaymentOrder, self).generate_party_agent( + return super().generate_party_agent( parent_node, party_type, order, partner_bank, gen_args, - bank_line=bank_line) + bank_line=bank_line, + ) @api.model - def generate_party_acc_number( - self, parent_node, party_type, order, partner_bank, gen_args, - bank_line=None): - if ( - gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and + def generate_party_acc_number(self, parent_node, party_type, order, + partner_bank, gen_args, bank_line=None): + if (gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and bank_line and bank_line.local_instrument == 'CH01'): if not partner_bank.ccp: @@ -102,6 +100,6 @@ def generate_party_acc_number( party_account_other_id.text = partner_bank.ccp return True else: - return super(AccountPaymentOrder, self).generate_party_acc_number( + return super().generate_party_acc_number( parent_node, party_type, order, partner_bank, gen_args, bank_line=bank_line) From 4e35d39aa12e39c2d7c942516d79a6805cce4e8e Mon Sep 17 00:00:00 2001 From: jcoux Date: Thu, 17 May 2018 14:55:14 +0200 Subject: [PATCH 09/28] [11.0][FIX] l10n_ch_pain_base - Fix migration script --- l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py b/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py index 90f97a314..172aadeff 100644 --- a/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py +++ b/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py @@ -6,7 +6,7 @@ def reference_type_bvr_to_isr(cr): """Change BVR to ISR in reference_type field""" cr.execute(""" - UPDATE account_invoice SET communication_type='isr' + UPDATE account_payment_line SET communication_type='isr' WHERE communication_type = 'bvr'; """) From b2d754b761da4ae116b98a26ee8fe59a8d0e49be Mon Sep 17 00:00:00 2001 From: lfr-opennet Date: Wed, 13 Jun 2018 13:14:54 +0200 Subject: [PATCH 10/28] [11.0][FIX] l10n_ch_pain_base - fix error message (#425) * [11.0][FIX] l10n_ch_pain_base - fix error message Fix of the field used on the UsserError message when no CCP account is set. The field 'partner_bank.name' doesn't exist, the corresponding field is 'partner_bank.acc_number' --- l10n_ch_pain_base/i18n/de.po | 8 ++-- l10n_ch_pain_base/i18n/fr.po | 12 +++--- l10n_ch_pain_base/i18n/it.po | 10 ++--- l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot | 42 +++++++++++++++++++ .../models/account_payment_order.py | 2 +- 5 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po index f6c534b3d..536320ad5 100644 --- a/l10n_ch_pain_base/i18n/de.po +++ b/l10n_ch_pain_base/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * l10n_ch_pain_base -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,17 +12,17 @@ msgstr "" "PO-Revision-Date: 2017-04-19 00:40+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"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: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format msgid "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the " "bank '%s' related to the bank account '%s'" msgstr "" @@ -42,7 +42,7 @@ msgid "Payment Order" msgstr "" #. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." msgstr "" diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po index 95508e430..4fcebca5d 100644 --- a/l10n_ch_pain_base/i18n/fr.po +++ b/l10n_ch_pain_base/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * l10n_ch_pain_base -# +# # Translators: # leemannd , 2017 # OCA Transbot , 2017 @@ -13,17 +13,17 @@ msgstr "" "PO-Revision-Date: 2017-12-01 03:54+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:73 -#, python-format +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 +#, fuzzy, python-format msgid "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the " "bank '%s' related to the bank account '%s'" msgstr "" "Pour pain.001.001.03.ch.02 et les payement non-BVR, le BIC est requis sur " @@ -45,7 +45,7 @@ msgid "Payment Order" msgstr "Ordre de paiement" #. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:92 +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." msgstr "" diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index 51dceaf9c..bde3b96cb 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * l10n_ch_pain_base -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,17 +12,17 @@ msgstr "" "PO-Revision-Date: 2017-03-03 03:39+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format msgid "" -"For pain.001.001.03.ch.02, for non-BVR payments, the BIC is required on the " +"For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the " "bank '%s' related to the bank account '%s'" msgstr "" @@ -42,7 +42,7 @@ msgid "Payment Order" msgstr "Ordine di Pagamento" #. module: l10n_ch_pain_base -#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:91 +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank '%s'." +msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." msgstr "" diff --git a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot new file mode 100644 index 000000000..954d131f9 --- /dev/null +++ b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \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: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 +#, python-format +msgid "For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the bank '%s' related to the bank account '%s'" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line +msgid "Payment Lines" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order +msgid "Payment Order" +msgstr "" + +#. module: l10n_ch_pain_base +#: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 +#, python-format +msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +msgstr "" + diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 545b1e610..afaafe77c 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -89,7 +89,7 @@ def generate_party_acc_number(self, parent_node, party_type, order, if not partner_bank.ccp: raise UserError(_( "The field 'CCP/CP-Konto' is not set on the bank " - "account '%s'.") % partner_bank.name) + "account '%s'.") % partner_bank.acc_number) party_account = etree.SubElement( parent_node, '%sAcct' % party_type) party_account_id = etree.SubElement(party_account, 'Id') From 9d4a97b3fcf3b140f8fbbdf6ef9eb3b13ec206e8 Mon Sep 17 00:00:00 2001 From: OCA git bot Date: Fri, 28 Sep 2018 17:53:42 +0200 Subject: [PATCH 11/28] [MIG] Make modules uninstallable --- l10n_ch_pain_base/__manifest__.py | 2 +- l10n_ch_pain_base/i18n/de.po | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 07de7a69a..2725c9589 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -17,5 +17,5 @@ 'views/account_payment_line.xml', 'views/bank_payment_line.xml', ], - 'installable': True, + 'installable': False, } diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po index 536320ad5..6160fb29a 100644 --- a/l10n_ch_pain_base/i18n/de.po +++ b/l10n_ch_pain_base/i18n/de.po @@ -9,14 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-04-19 00:40+0000\n" -"PO-Revision-Date: 2017-04-19 00:40+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2018-11-23 22:11+0000\n" +"Last-Translator: chrispi-ch \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.2.2\n" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 @@ -25,24 +26,26 @@ msgid "" "For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the " "bank '%s' related to the bank account '%s'" msgstr "" +"Bei pain.001.001.03.ch.02 ist für Nicht-ESR-Zahlungen der BIC zur Bank '%s' " +"des Bankkontos '%s' erforderlich" #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_move_line msgid "Journal Item" -msgstr "Journalbuchung" +msgstr "Journaleintrag" #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line msgid "Payment Lines" -msgstr "" +msgstr "Zahlungszeilen" #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order msgid "Payment Order" -msgstr "" +msgstr "Zahlungsauftrag" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." -msgstr "" +msgstr "Das Feld 'Postkonto' ist beim Bankkonto '%s' nicht gesetzt." From 6ca91961623cb661f02198e3285c4cc6bdf567a8 Mon Sep 17 00:00:00 2001 From: Alexandre Saunier Date: Mon, 11 Feb 2019 16:13:23 +0100 Subject: [PATCH 12/28] [MIG] l10n_ch_pain_base: Migration to odoo 12 --- l10n_ch_pain_base/README.rst | 72 ++- l10n_ch_pain_base/__manifest__.py | 4 +- l10n_ch_pain_base/i18n/de.po | 35 ++ l10n_ch_pain_base/i18n/fr.po | 48 +- l10n_ch_pain_base/i18n/it.po | 35 ++ l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot | 37 +- .../migrations/11.0.1.0.0/post-migration.py | 16 - l10n_ch_pain_base/models/account_move_line.py | 3 +- .../models/account_payment_line.py | 3 +- l10n_ch_pain_base/readme/CONTRIBUTORS.rst | 3 + l10n_ch_pain_base/readme/DESCRIPTION.rst | 4 + l10n_ch_pain_base/static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 426 ++++++++++++++++++ 13 files changed, 634 insertions(+), 52 deletions(-) delete mode 100644 l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py create mode 100644 l10n_ch_pain_base/readme/CONTRIBUTORS.rst create mode 100644 l10n_ch_pain_base/readme/DESCRIPTION.rst create mode 100644 l10n_ch_pain_base/static/description/icon.png create mode 100644 l10n_ch_pain_base/static/description/index.html diff --git a/l10n_ch_pain_base/README.rst b/l10n_ch_pain_base/README.rst index eac70b73f..1775ec026 100644 --- a/l10n_ch_pain_base/README.rst +++ b/l10n_ch_pain_base/README.rst @@ -1,53 +1,79 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=================================== -Switzerland - ISO 20022 base module -=================================== +======================= +Switzerland - ISO 20022 +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-switzerland/tree/12.0/l10n_ch_pain_base + :alt: OCA/l10n-switzerland +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-switzerland-12-0/l10n-switzerland-12-0-l10n_ch_pain_base + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/125/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module doesn't do anything by himself. It is the base module for 2 other modules: * the module *l10n_ch_pain_credit_transfer* which adds support for the file format *pain.001.001.03.ch.02* which is used for ISO 20022 credit transfers (SEPA or not SEPA), - * the module *l10n_ch_pain_direct_debit* which adds support for the file format *pain.008.001.02.ch.01* which is used for ISO 20022 direct debits. -Usage -===== +**Table of contents** -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/125/11.0 +.. contents:: + :local: 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. +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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Akretion +* Camptocamp + Contributors ------------- +~~~~~~~~~~~~ * Alexis de Lattre * Denis Leemann * Mykhailo Panarin -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/l10n-switzerland `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 2725c9589..52ce92adf 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "11.0.1.0.0", + "version": "12.0.1.0.0", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", @@ -17,5 +17,5 @@ 'views/account_payment_line.xml', 'views/bank_payment_line.xml', ], - 'installable': False, + 'installable': True, } diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po index 6160fb29a..547771622 100644 --- a/l10n_ch_pain_base/i18n/de.po +++ b/l10n_ch_pain_base/i18n/de.po @@ -19,6 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 3.2.2\n" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "CH01 (ISR)" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__communication_type +msgid "Communication Type" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format @@ -29,11 +39,36 @@ msgstr "" "Bei pain.001.001.03.ch.02 ist für Nicht-ESR-Zahlungen der BIC zur Bank '%s' " "des Bankkontos '%s' erforderlich" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "Free" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISO" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISR" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_move_line msgid "Journal Item" msgstr "Journaleintrag" +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__local_instrument +msgid "Local Instrument" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line msgid "Payment Lines" diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po index 4fcebca5d..c0cefbca5 100644 --- a/l10n_ch_pain_base/i18n/fr.po +++ b/l10n_ch_pain_base/i18n/fr.po @@ -10,30 +10,66 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-01 03:54+0000\n" -"PO-Revision-Date: 2017-12-01 03:54+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2019-08-14 09:44+0000\n" +"Last-Translator: Valaeys Stéphane \n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "CH01 (ISR)" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__communication_type +msgid "Communication Type" +msgstr "" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 -#, fuzzy, python-format +#, python-format msgid "" "For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the " "bank '%s' related to the bank account '%s'" msgstr "" -"Pour pain.001.001.03.ch.02 et les payement non-BVR, le BIC est requis sur " +"Pour pain.001.001.03.ch.02 et les paiements non-BVR, le BIC est requis sur " "les Banques '%s' lié au compte bancaire '%s'" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "Free" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISO" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISR" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_move_line msgid "Journal Item" msgstr "Écriture comptable" +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__local_instrument +msgid "Local Instrument" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line msgid "Payment Lines" @@ -48,4 +84,4 @@ msgstr "Ordre de paiement" #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." -msgstr "" +msgstr "Le champ 'CCP' n'est pas défini sur le compte bancaire '%s'." diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index bde3b96cb..e348080fb 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -18,6 +18,16 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "CH01 (ISR)" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__communication_type +msgid "Communication Type" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format @@ -26,11 +36,36 @@ msgid "" "bank '%s' related to the bank account '%s'" msgstr "" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "Free" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISO" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISR" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_move_line msgid "Journal Item" msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__local_instrument +msgid "Local Instrument" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line msgid "Payment Lines" diff --git a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot index 954d131f9..5edc8cb25 100644 --- a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot +++ b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -13,17 +13,52 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "CH01 (ISR)" +msgstr "" + +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__communication_type +msgid "Communication Type" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:72 #, python-format msgid "For pain.001.001.03.ch.02, for non-ISR payments, the BIC is required on the bank '%s' related to the bank account '%s'" msgstr "" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "Free" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISO" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "ISR" +msgstr "" + +#. module: l10n_ch_pain_base +#: selection:account.payment.line,local_instrument:0 +msgid "Instant Transfer" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_move_line msgid "Journal Item" msgstr "" +#. module: l10n_ch_pain_base +#: model:ir.model.fields,field_description:l10n_ch_pain_base.field_account_payment_line__local_instrument +msgid "Local Instrument" +msgstr "" + #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_line msgid "Payment Lines" diff --git a/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py b/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py deleted file mode 100644 index 172aadeff..000000000 --- a/l10n_ch_pain_base/migrations/11.0.1.0.0/post-migration.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2018 Camptocamp -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openupgradelib import openupgrade - - -def reference_type_bvr_to_isr(cr): - """Change BVR to ISR in reference_type field""" - cr.execute(""" - UPDATE account_payment_line SET communication_type='isr' - WHERE communication_type = 'bvr'; - """) - - -@openupgrade.migrate() -def migrate(env, version): - reference_type_bvr_to_isr(env.cr) diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index bfed64a18..3d824df83 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -9,8 +9,7 @@ class AccountMoveLine(models.Model): @api.multi def _prepare_payment_line_vals(self, payment_order): - vals = super(AccountMoveLine, self)._prepare_payment_line_vals( - payment_order) + vals = super()._prepare_payment_line_vals(payment_order) if self.invoice_id and self.invoice_id.reference_type == 'isr': vals['local_instrument'] = 'CH01' if vals['communication']: diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index a5c8a028e..28cd4c063 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -12,7 +12,6 @@ class AccountPaymentLine(models.Model): communication_type = fields.Selection(selection_add=[('isr', 'ISR')]) def invoice_reference_type2communication_type(self): - res = super(AccountPaymentLine, self).\ - invoice_reference_type2communication_type() + res = super().invoice_reference_type2communication_type() res['isr'] = 'isr' return res diff --git a/l10n_ch_pain_base/readme/CONTRIBUTORS.rst b/l10n_ch_pain_base/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..4f35f64a5 --- /dev/null +++ b/l10n_ch_pain_base/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Alexis de Lattre +* Denis Leemann +* Mykhailo Panarin diff --git a/l10n_ch_pain_base/readme/DESCRIPTION.rst b/l10n_ch_pain_base/readme/DESCRIPTION.rst new file mode 100644 index 000000000..be01b0c7c --- /dev/null +++ b/l10n_ch_pain_base/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module doesn't do anything by himself. It is the base module for 2 other modules: + +* the module *l10n_ch_pain_credit_transfer* which adds support for the file format *pain.001.001.03.ch.02* which is used for ISO 20022 credit transfers (SEPA or not SEPA), +* the module *l10n_ch_pain_direct_debit* which adds support for the file format *pain.008.001.02.ch.01* which is used for ISO 20022 direct debits. diff --git a/l10n_ch_pain_base/static/description/icon.png b/l10n_ch_pain_base/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 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 z 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 Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/l10n_ch_pain_base/static/description/index.html b/l10n_ch_pain_base/static/description/index.html new file mode 100644 index 000000000..8747dbb49 --- /dev/null +++ b/l10n_ch_pain_base/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Switzerland - ISO 20022 + + + +
+

Switzerland - ISO 20022

+ + +

Beta License: AGPL-3 OCA/l10n-switzerland Translate me on Weblate Try me on Runbot

+

This module doesn’t do anything by himself. It is the base module for 2 other modules:

+
    +
  • the module l10n_ch_pain_credit_transfer which adds support for the file format pain.001.001.03.ch.02 which is used for ISO 20022 credit transfers (SEPA or not SEPA),
  • +
  • the module l10n_ch_pain_direct_debit which adds support for the file format pain.008.001.02.ch.01 which is used for ISO 20022 direct debits.
  • +
+

Table of contents

+ +
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/l10n-switzerland project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From 9f01bd2e338c73932681eca9bb31460ce151e50c Mon Sep 17 00:00:00 2001 From: Patrick Tombez Date: Wed, 20 Mar 2019 14:50:22 +0100 Subject: [PATCH 13/28] [11.0] l10n_ch_pain_base: Override address block for Swiss specs --- l10n_ch_pain_base/__manifest__.py | 2 +- .../models/account_payment_order.py | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 52ce92adf..0b0e6627d 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "12.0.1.0.0", + "version": "12.0.1.0.1", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index afaafe77c..8ad309889 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -103,3 +103,25 @@ def generate_party_acc_number(self, parent_node, party_type, order, return super().generate_party_acc_number( parent_node, party_type, order, partner_bank, gen_args, bank_line=bank_line) + + @api.model + def generate_address_block( + self, parent_node, partner, gen_args): + """Generate the piece of the XML corresponding to PstlAdr""" + if partner.country_id: + postal_address = etree.SubElement(parent_node, 'PstlAdr') + + country = etree.SubElement(postal_address, 'Ctry') + country.text = self._prepare_field( + 'Country', 'partner.country_id.code', + {'partner': partner}, 2, gen_args=gen_args) + + adrline1 = etree.SubElement(postal_address, 'AdrLine') + adrline1.text = ', '.join( + filter(None, [partner.street, partner.street2]) + ) + + adrline2 = etree.SubElement(postal_address, 'AdrLine') + adrline2.text = ' '.join([partner.zip, partner.city]) + + return True From edb501b2cb9ddccc2915de2150c208f9f01138ec Mon Sep 17 00:00:00 2001 From: Patrick Tombez Date: Thu, 28 Mar 2019 10:55:53 +0100 Subject: [PATCH 14/28] [11.0] l10n_ch_pain_base: Fix empty address block generation --- l10n_ch_pain_base/models/account_payment_order.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 8ad309889..6e5a4ca23 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -116,12 +116,14 @@ def generate_address_block( 'Country', 'partner.country_id.code', {'partner': partner}, 2, gen_args=gen_args) - adrline1 = etree.SubElement(postal_address, 'AdrLine') - adrline1.text = ', '.join( - filter(None, [partner.street, partner.street2]) - ) + if partner.street or partner.street2: + adrline1 = etree.SubElement(postal_address, 'AdrLine') + adrline1.text = ', '.join( + filter(None, [partner.street, partner.street2]) + ) - adrline2 = etree.SubElement(postal_address, 'AdrLine') - adrline2.text = ' '.join([partner.zip, partner.city]) + if partner.zip and partner.city: + adrline2 = etree.SubElement(postal_address, 'AdrLine') + adrline2.text = ' '.join([partner.zip, partner.city]) return True From ac3ff7ccd2a3bff4ed341a0a1affed55a71f455e Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 3 Sep 2019 11:40:38 +0200 Subject: [PATCH 15/28] Pain.001 use l10n_ch_postal field Plus drop the need of ISR reference type on invoice --- l10n_ch_pain_base/__manifest__.py | 2 +- l10n_ch_pain_base/models/account_move_line.py | 3 ++- l10n_ch_pain_base/models/account_payment_order.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 0b0e6627d..92c2a0213 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "12.0.1.0.1", + "version": "12.0.2.0.0", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 3d824df83..3882b42d9 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -10,8 +10,9 @@ class AccountMoveLine(models.Model): @api.multi def _prepare_payment_line_vals(self, payment_order): vals = super()._prepare_payment_line_vals(payment_order) - if self.invoice_id and self.invoice_id.reference_type == 'isr': + if self.invoice_id and self.invoice_id._is_isr_reference(): vals['local_instrument'] = 'CH01' + vals['communication_type'] = 'isr' if vals['communication']: vals['communication'] = vals['communication'].replace(' ', '') return vals diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 6e5a4ca23..a8468a326 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -86,9 +86,9 @@ def generate_party_acc_number(self, parent_node, party_type, order, if (gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and bank_line and bank_line.local_instrument == 'CH01'): - if not partner_bank.ccp: + if not partner_bank.l10n_ch_postal: raise UserError(_( - "The field 'CCP/CP-Konto' is not set on the bank " + "The field 'Postal account' is not set on the bank " "account '%s'.") % partner_bank.acc_number) party_account = etree.SubElement( parent_node, '%sAcct' % party_type) @@ -97,7 +97,7 @@ def generate_party_acc_number(self, parent_node, party_type, order, party_account_id, 'Othr') party_account_other_id = etree.SubElement( party_account_other, 'Id') - party_account_other_id.text = partner_bank.ccp + party_account_other_id.text = partner_bank.l10n_ch_postal return True else: return super().generate_party_acc_number( From 3615fa1e08021afb7cc7119f6841da9614f21710 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 2 Oct 2019 14:46:15 +0000 Subject: [PATCH 16/28] [UPD] Update l10n_ch_pain_base.pot --- l10n_ch_pain_base/i18n/de.po | 4 ++-- l10n_ch_pain_base/i18n/fr.po | 4 ++-- l10n_ch_pain_base/i18n/it.po | 2 +- l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po index 547771622..55d86302d 100644 --- a/l10n_ch_pain_base/i18n/de.po +++ b/l10n_ch_pain_base/i18n/de.po @@ -81,6 +81,6 @@ msgstr "Zahlungsauftrag" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 -#, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +#, fuzzy, python-format +msgid "The field 'Postal account' is not set on the bank account '%s'." msgstr "Das Feld 'Postkonto' ist beim Bankkonto '%s' nicht gesetzt." diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po index c0cefbca5..df751db26 100644 --- a/l10n_ch_pain_base/i18n/fr.po +++ b/l10n_ch_pain_base/i18n/fr.po @@ -82,6 +82,6 @@ msgstr "Ordre de paiement" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 -#, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +#, fuzzy, python-format +msgid "The field 'Postal account' is not set on the bank account '%s'." msgstr "Le champ 'CCP' n'est pas défini sur le compte bancaire '%s'." diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index e348080fb..bf037f687 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -79,5 +79,5 @@ msgstr "Ordine di Pagamento" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +msgid "The field 'Postal account' is not set on the bank account '%s'." msgstr "" diff --git a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot index 5edc8cb25..e3c99e618 100644 --- a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot +++ b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot @@ -72,6 +72,6 @@ msgstr "" #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format -msgid "The field 'CCP/CP-Konto' is not set on the bank account '%s'." +msgid "The field 'Postal account' is not set on the bank account '%s'." msgstr "" From 55242b1b386461f0cc94171464160d590b6ccfbd Mon Sep 17 00:00:00 2001 From: david Date: Wed, 25 Nov 2020 08:58:19 +0100 Subject: [PATCH 17/28] # This is a combination of 4 commits. # This is the 1st commit message: 85a93e806e5b41883375082d5036f63c2dc78e5c # This is the commit message #2: use qr_iban validation methode # This is the commit message #3: fix commit # This is the commit message #4: remove debug info --- l10n_ch_pain_base/models/account_move_line.py | 8 ++++--- .../models/account_payment_line.py | 2 +- .../models/account_payment_order.py | 22 +++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 3882b42d9..ddb6663a9 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -3,7 +3,6 @@ from odoo import models, api - class AccountMoveLine(models.Model): _inherit = 'account.move.line' @@ -11,8 +10,11 @@ class AccountMoveLine(models.Model): def _prepare_payment_line_vals(self, payment_order): vals = super()._prepare_payment_line_vals(payment_order) if self.invoice_id and self.invoice_id._is_isr_reference(): - vals['local_instrument'] = 'CH01' - vals['communication_type'] = 'isr' + if self.invoice_id.partner_bank_id._is_qr_iban(): + vals['communication_type'] = 'qrr' + else: + vals['local_instrument'] = 'CH01' + vals['communication_type'] = 'isr' if vals['communication']: vals['communication'] = vals['communication'].replace(' ', '') return vals diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index 28cd4c063..a63c28a32 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -9,7 +9,7 @@ class AccountPaymentLine(models.Model): local_instrument = fields.Selection( selection_add=[('CH01', 'CH01 (ISR)')]) - communication_type = fields.Selection(selection_add=[('isr', 'ISR')]) + communication_type = fields.Selection(selection_add=[('isr', 'ISR'), ('qrr', 'QRR')]) def invoice_reference_type2communication_type(self): res = super().invoice_reference_type2communication_type() diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index a8468a326..9a3047e64 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -127,3 +127,25 @@ def generate_address_block( adrline2.text = ' '.join([partner.zip, partner.city]) return True + + @api.model + def generate_remittance_info_block(self, parent_node, line, gen_args): + if line.communication_type == "qrr": + remittance_info = etree.SubElement( + parent_node, 'RmtInf') + remittance_info_structured = etree.SubElement( + remittance_info, 'Strd') + creditor_ref_information = etree.SubElement( + remittance_info_structured, 'CdtrRefInf') + 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, 'Prtry') + creditor_ref_info_type_code.text = 'QRR' + creditor_reference = etree.SubElement( + creditor_ref_information, 'Ref') + creditor_reference.text = line.payment_line_ids[0].communication + else: + super().generate_remittance_info_block(parent_node, line, gen_args) From 0f75759c2b03bddf46445d05ebb898a703c817bd Mon Sep 17 00:00:00 2001 From: david Date: Fri, 4 Dec 2020 14:32:31 +0100 Subject: [PATCH 18/28] Add the ability to include a QR invoice with QRR on a payement order and produce a pain001 expected (according to SIX implementation-guidelines-ct) --- l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot | 5 +++++ l10n_ch_pain_base/models/account_move_line.py | 1 + l10n_ch_pain_base/models/account_payment_line.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot index e3c99e618..81f31b421 100644 --- a/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot +++ b/l10n_ch_pain_base/i18n/l10n_ch_pain_base.pot @@ -69,6 +69,11 @@ msgstr "" msgid "Payment Order" msgstr "" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "QRR" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index ddb6663a9..9754007ce 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -3,6 +3,7 @@ from odoo import models, api + class AccountMoveLine(models.Model): _inherit = 'account.move.line' diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index a63c28a32..4b98efdb6 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -9,7 +9,8 @@ class AccountPaymentLine(models.Model): local_instrument = fields.Selection( selection_add=[('CH01', 'CH01 (ISR)')]) - communication_type = fields.Selection(selection_add=[('isr', 'ISR'), ('qrr', 'QRR')]) + communication_type = fields.Selection(selection_add=[ + ('isr', 'ISR'), ('qrr', 'QRR')]) def invoice_reference_type2communication_type(self): res = super().invoice_reference_type2communication_type() From 78d873b11e833dcedd67bbc9194a307c13fd4a87 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 14 Jan 2021 10:30:59 +0000 Subject: [PATCH 19/28] l10n_ch_pain_base 12.0.2.1.0 --- l10n_ch_pain_base/__manifest__.py | 2 +- l10n_ch_pain_base/i18n/de.po | 5 +++++ l10n_ch_pain_base/i18n/fr.po | 5 +++++ l10n_ch_pain_base/i18n/it.po | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 92c2a0213..884e3001d 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "12.0.2.0.0", + "version": "12.0.2.1.0", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/l10n_ch_pain_base/i18n/de.po b/l10n_ch_pain_base/i18n/de.po index 55d86302d..56c16a821 100644 --- a/l10n_ch_pain_base/i18n/de.po +++ b/l10n_ch_pain_base/i18n/de.po @@ -79,6 +79,11 @@ msgstr "Zahlungszeilen" msgid "Payment Order" msgstr "Zahlungsauftrag" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "QRR" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, fuzzy, python-format diff --git a/l10n_ch_pain_base/i18n/fr.po b/l10n_ch_pain_base/i18n/fr.po index df751db26..e8bea309f 100644 --- a/l10n_ch_pain_base/i18n/fr.po +++ b/l10n_ch_pain_base/i18n/fr.po @@ -80,6 +80,11 @@ msgstr "Lignes de Paiement" msgid "Payment Order" msgstr "Ordre de paiement" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "QRR" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, fuzzy, python-format diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index bf037f687..39823d224 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -76,6 +76,11 @@ msgstr "" msgid "Payment Order" msgstr "Ordine di Pagamento" +#. module: l10n_ch_pain_base +#: selection:account.payment.line,communication_type:0 +msgid "QRR" +msgstr "" + #. module: l10n_ch_pain_base #: code:addons/l10n_ch_pain_base/models/account_payment_order.py:90 #, python-format From e977f4fb4d118fd4375f4480d2a68291965de067 Mon Sep 17 00:00:00 2001 From: Iryna Vyshnevska Date: Thu, 13 May 2021 13:12:07 +0300 Subject: [PATCH 20/28] [12.0][FIX] check if bank attached to not raise sigleton error --- l10n_ch_pain_base/models/account_move_line.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 9754007ce..09f9711a7 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -10,7 +10,11 @@ class AccountMoveLine(models.Model): @api.multi def _prepare_payment_line_vals(self, payment_order): vals = super()._prepare_payment_line_vals(payment_order) - if self.invoice_id and self.invoice_id._is_isr_reference(): + if ( + self.invoice_id + and self.invoice_id._is_isr_reference() + and self.invoice_id.partner_bank_id + ): if self.invoice_id.partner_bank_id._is_qr_iban(): vals['communication_type'] = 'qrr' else: From 9cd912e31f121cf2893cf7a801925b2edce95d6a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 9 Jun 2021 09:39:17 +0000 Subject: [PATCH 21/28] l10n_ch_pain_base 12.0.2.1.1 --- l10n_ch_pain_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 884e3001d..56d1e6968 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "12.0.2.1.0", + "version": "12.0.2.1.1", "category": "Finance", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", From 952bcd5c2d068492d6be47cd7b7e511fef92e4c9 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 5 May 2023 11:52:23 +0200 Subject: [PATCH 22/28] [IMP] l10n_ch_pain_base: black, isort, prettier --- l10n_ch_pain_base/__manifest__.py | 15 +- l10n_ch_pain_base/models/account_move_line.py | 14 +- .../models/account_payment_line.py | 14 +- .../models/account_payment_order.py | 169 ++++++++++-------- .../views/account_payment_line.xml | 7 +- l10n_ch_pain_base/views/bank_payment_line.xml | 7 +- 6 files changed, 126 insertions(+), 100 deletions(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 56d1e6968..7170a7a7f 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,17 +5,12 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "12.0.2.1.1", + "version": "13.0.1.0.0", "category": "Finance", + "website": "https://github.com/OCA/l10n-switzerland", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": [ - "account_banking_pain_base", - "l10n_ch_base_bank", - ], - "data": [ - 'views/account_payment_line.xml', - 'views/bank_payment_line.xml', - ], - 'installable': True, + "depends": ["account_banking_pain_base", "l10n_ch_base_bank"], + "data": ["views/account_payment_line.xml", "views/bank_payment_line.xml"], + "installable": True, } diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 09f9711a7..af2adc4f4 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -1,11 +1,11 @@ # copyright 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, api +from odoo import api, models class AccountMoveLine(models.Model): - _inherit = 'account.move.line' + _inherit = "account.move.line" @api.multi def _prepare_payment_line_vals(self, payment_order): @@ -16,10 +16,10 @@ def _prepare_payment_line_vals(self, payment_order): and self.invoice_id.partner_bank_id ): if self.invoice_id.partner_bank_id._is_qr_iban(): - vals['communication_type'] = 'qrr' + vals["communication_type"] = "qrr" else: - vals['local_instrument'] = 'CH01' - vals['communication_type'] = 'isr' - if vals['communication']: - vals['communication'] = vals['communication'].replace(' ', '') + vals["local_instrument"] = "CH01" + vals["communication_type"] = "isr" + if vals["communication"]: + vals["communication"] = vals["communication"].replace(" ", "") return vals diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index 4b98efdb6..033590810 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -1,18 +1,18 @@ # copyright 2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class AccountPaymentLine(models.Model): - _inherit = 'account.payment.line' + _inherit = "account.payment.line" - local_instrument = fields.Selection( - selection_add=[('CH01', 'CH01 (ISR)')]) - communication_type = fields.Selection(selection_add=[ - ('isr', 'ISR'), ('qrr', 'QRR')]) + local_instrument = fields.Selection(selection_add=[("CH01", "CH01 (ISR)")]) + communication_type = fields.Selection( + selection_add=[("isr", "ISR"), ("qrr", "QRR")] + ) def invoice_reference_type2communication_type(self): res = super().invoice_reference_type2communication_type() - res['isr'] = 'isr' + res["isr"] = "isr" return res diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 9a3047e64..68fe5f941 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -1,13 +1,14 @@ # copyright 2016 Akretion (www.akretion.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, api, _ -from odoo.exceptions import UserError from lxml import etree +from odoo import _, api, models +from odoo.exceptions import UserError + class AccountPaymentOrder(models.Model): - _inherit = 'account.payment.order' + _inherit = "account.payment.order" @api.multi def compute_sepa_final_hook(self, sepa): @@ -15,7 +16,7 @@ def compute_sepa_final_hook(self, sepa): sepa = super().compute_sepa_final_hook(sepa) pain_flavor = self.payment_mode_id.payment_method_id.pain_version # ISR orders cannot be SEPA orders - if pain_flavor and '.ch.' in pain_flavor: + if pain_flavor and ".ch." in pain_flavor: sepa = False return sepa @@ -24,9 +25,10 @@ def generate_pain_nsmap(self): self.ensure_one() nsmap = super().generate_pain_nsmap() pain_flavor = self.payment_mode_id.payment_method_id.pain_version - if pain_flavor in ['pain.001.001.03.ch.02', 'pain.008.001.02.ch.01']: - nsmap[None] = 'http://www.six-interbank-clearing.com/de/'\ - '%s.xsd' % pain_flavor + if pain_flavor in ["pain.001.001.03.ch.02", "pain.008.001.02.ch.01"]: + nsmap[None] = ( + "http://www.six-interbank-clearing.com/de/" "%s.xsd" % pain_flavor + ) return nsmap @@ -34,118 +36,141 @@ def generate_pain_nsmap(self): def generate_pain_attrib(self): self.ensure_one() pain_flavor = self.payment_mode_id.payment_method_id.pain_version - if pain_flavor in ['pain.001.001.03.ch.02', 'pain.008.001.02.ch.01']: + if pain_flavor in ["pain.001.001.03.ch.02", "pain.008.001.02.ch.01"]: attrib = { - "{http://www.w3.org/2001/XMLSchema-instance}schemaLocation": - "http://www.six-interbank-clearing.com/de/" + "{http://www.w3.org/2001/XMLSchema-instance}schemaLocation": "http://www.six-interbank-clearing.com/de/" "%s.xsd %s.xsd" % (pain_flavor, pain_flavor) - } + } return attrib else: return super().generate_pain_attrib() @api.model def generate_start_payment_info_block( - self, parent_node, payment_info_ident, - priority, local_instrument, category_purpose, sequence_type, - requested_date, eval_ctx, gen_args): - if gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02': - gen_args['local_instrument_type'] = 'proprietary' - gen_args['structured_remittance_issuer'] = False + self, + parent_node, + payment_info_ident, + priority, + local_instrument, + category_purpose, + sequence_type, + requested_date, + eval_ctx, + gen_args, + ): + if gen_args.get("pain_flavor") == "pain.001.001.03.ch.02": + gen_args["local_instrument_type"] = "proprietary" + gen_args["structured_remittance_issuer"] = False return super().generate_start_payment_info_block( - parent_node, payment_info_ident, priority, local_instrument, - category_purpose, sequence_type, requested_date, eval_ctx, + parent_node, + payment_info_ident, + priority, + local_instrument, + category_purpose, + sequence_type, + requested_date, + eval_ctx, gen_args, ) @api.model def generate_party_agent( - self, parent_node, party_type, order, partner_bank, gen_args, - bank_line=None): - if ( - gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and - bank_line): - if bank_line.local_instrument == 'CH01': + self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None + ): + if gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" and bank_line: + if bank_line.local_instrument == "CH01": # Don't set the creditor agent on ISR/CH01 payments return True elif not partner_bank.bank_bic: - raise UserError(_( - "For pain.001.001.03.ch.02, for non-ISR payments, " - "the BIC is required on the bank '%s' related to the " - "bank account '%s'") % ( - partner_bank.bank_id.name, - partner_bank.acc_number)) + raise UserError( + _( + "For pain.001.001.03.ch.02, for non-ISR payments, " + "the BIC is required on the bank '%s' related to the " + "bank account '%s'" + ) + % (partner_bank.bank_id.name, partner_bank.acc_number) + ) return super().generate_party_agent( - parent_node, party_type, order, partner_bank, gen_args, - bank_line=bank_line, + parent_node, party_type, order, partner_bank, gen_args, bank_line=bank_line, ) @api.model - def generate_party_acc_number(self, parent_node, party_type, order, - partner_bank, gen_args, bank_line=None): - if (gen_args.get('pain_flavor') == 'pain.001.001.03.ch.02' and - bank_line and - bank_line.local_instrument == 'CH01'): + def generate_party_acc_number( + self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None + ): + if ( + gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" + and bank_line + and bank_line.local_instrument == "CH01" + ): if not partner_bank.l10n_ch_postal: - raise UserError(_( - "The field 'Postal account' is not set on the bank " - "account '%s'.") % partner_bank.acc_number) - party_account = etree.SubElement( - parent_node, '%sAcct' % party_type) - party_account_id = etree.SubElement(party_account, 'Id') - party_account_other = etree.SubElement( - party_account_id, 'Othr') - party_account_other_id = etree.SubElement( - party_account_other, 'Id') + raise UserError( + _( + "The field 'Postal account' is not set on the bank " + "account '%s'." + ) + % partner_bank.acc_number + ) + party_account = etree.SubElement(parent_node, "%sAcct" % party_type) + party_account_id = etree.SubElement(party_account, "Id") + 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.l10n_ch_postal return True else: return super().generate_party_acc_number( - parent_node, party_type, order, partner_bank, gen_args, - bank_line=bank_line) + parent_node, + party_type, + order, + partner_bank, + gen_args, + bank_line=bank_line, + ) @api.model - def generate_address_block( - self, parent_node, partner, gen_args): + def generate_address_block(self, parent_node, partner, gen_args): """Generate the piece of the XML corresponding to PstlAdr""" if partner.country_id: - postal_address = etree.SubElement(parent_node, 'PstlAdr') + postal_address = etree.SubElement(parent_node, "PstlAdr") - country = etree.SubElement(postal_address, 'Ctry') + country = etree.SubElement(postal_address, "Ctry") country.text = self._prepare_field( - 'Country', 'partner.country_id.code', - {'partner': partner}, 2, gen_args=gen_args) + "Country", + "partner.country_id.code", + {"partner": partner}, + 2, + gen_args=gen_args, + ) if partner.street or partner.street2: - adrline1 = etree.SubElement(postal_address, 'AdrLine') - adrline1.text = ', '.join( + adrline1 = etree.SubElement(postal_address, "AdrLine") + adrline1.text = ", ".join( filter(None, [partner.street, partner.street2]) ) if partner.zip and partner.city: - adrline2 = etree.SubElement(postal_address, 'AdrLine') - adrline2.text = ' '.join([partner.zip, partner.city]) + adrline2 = etree.SubElement(postal_address, "AdrLine") + adrline2.text = " ".join([partner.zip, partner.city]) return True @api.model def generate_remittance_info_block(self, parent_node, line, gen_args): if line.communication_type == "qrr": - remittance_info = etree.SubElement( - parent_node, 'RmtInf') - remittance_info_structured = etree.SubElement( - remittance_info, 'Strd') + remittance_info = etree.SubElement(parent_node, "RmtInf") + remittance_info_structured = etree.SubElement(remittance_info, "Strd") creditor_ref_information = etree.SubElement( - remittance_info_structured, 'CdtrRefInf') - creditor_ref_info_type = etree.SubElement( - creditor_ref_information, 'Tp') + remittance_info_structured, "CdtrRefInf" + ) + 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, "CdOrPrtry" + ) creditor_ref_info_type_code = etree.SubElement( - creditor_ref_info_type_or, 'Prtry') - creditor_ref_info_type_code.text = 'QRR' - creditor_reference = etree.SubElement( - creditor_ref_information, 'Ref') + creditor_ref_info_type_or, "Prtry" + ) + creditor_ref_info_type_code.text = "QRR" + creditor_reference = etree.SubElement(creditor_ref_information, "Ref") creditor_reference.text = line.payment_line_ids[0].communication else: super().generate_remittance_info_block(parent_node, line, gen_args) diff --git a/l10n_ch_pain_base/views/account_payment_line.xml b/l10n_ch_pain_base/views/account_payment_line.xml index 14fa141b0..58c406ec6 100644 --- a/l10n_ch_pain_base/views/account_payment_line.xml +++ b/l10n_ch_pain_base/views/account_payment_line.xml @@ -1,4 +1,4 @@ - + -

Beta License: AGPL-3 OCA/l10n-switzerland Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/l10n-switzerland Translate me on Weblate Try me on Runboat

This module doesn’t do anything by himself. It is the base module for 2 other modules:

  • the module l10n_ch_pain_credit_transfer which adds support for the file format pain.001.001.03.ch.02 which is used for ISO 20022 credit transfers (SEPA or not SEPA),
  • @@ -376,34 +378,34 @@

    Switzerland - ISO 20022

    Table of contents

    -

    Bug Tracker

    +

    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.

    +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Akretion
    • Camptocamp
    -

    Contributors

    +

    Contributors

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association

    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.

    -

    This module is part of the OCA/l10n-switzerland project on GitHub.

    +

    This module is part of the OCA/l10n-switzerland project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/l10n_ch_pain_base/views/bank_payment_line.xml b/l10n_ch_pain_base/views/bank_payment_line.xml deleted file mode 100644 index a67b89c1f..000000000 --- a/l10n_ch_pain_base/views/bank_payment_line.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - l10n_ch_sepa.bank.payment.line.form - bank.payment.line - - - - 0 - - - - - From 8a4dedae30150da6f4f047a750ea3ade6a455ab5 Mon Sep 17 00:00:00 2001 From: mymage Date: Fri, 23 Feb 2024 12:13:43 +0000 Subject: [PATCH 26/28] Translated using Weblate (Italian) Currently translated at 7.6% (1 of 13 strings) Translation: l10n-switzerland-14.0/l10n-switzerland-14.0-l10n_ch_pain_base Translate-URL: https://translation.odoo-community.org/projects/l10n-switzerland-14-0/l10n-switzerland-14-0-l10n_ch_pain_base/it/ --- l10n_ch_pain_base/i18n/it.po | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/l10n_ch_pain_base/i18n/it.po b/l10n_ch_pain_base/i18n/it.po index 39823d224..58c49c548 100644 --- a/l10n_ch_pain_base/i18n/it.po +++ b/l10n_ch_pain_base/i18n/it.po @@ -9,14 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-03 03:39+0000\n" -"PO-Revision-Date: 2017-03-03 03:39+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2024-02-23 14:37+0000\n" +"Last-Translator: mymage \n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: l10n_ch_pain_base #: selection:account.payment.line,local_instrument:0 @@ -74,7 +75,7 @@ msgstr "" #. module: l10n_ch_pain_base #: model:ir.model,name:l10n_ch_pain_base.model_account_payment_order msgid "Payment Order" -msgstr "Ordine di Pagamento" +msgstr "Ordine di pagamento" #. module: l10n_ch_pain_base #: selection:account.payment.line,communication_type:0 From 38f5891477ddeebcc9e04217825773a861e1b637 Mon Sep 17 00:00:00 2001 From: BT-anieto Date: Tue, 11 Jun 2024 16:16:46 +0200 Subject: [PATCH 27/28] [IMP] l10n_ch_pain_base: pre-commit stuff --- l10n_ch_pain_base/models/account_payment_order.py | 10 ++++++---- setup/l10n_ch_pain_base/odoo/addons/l10n_ch_pain_base | 1 + setup/l10n_ch_pain_base/setup.py | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 120000 setup/l10n_ch_pain_base/odoo/addons/l10n_ch_pain_base create mode 100644 setup/l10n_ch_pain_base/setup.py diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 7b86930b4..59f518b05 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -83,10 +83,11 @@ def generate_party_agent( raise UserError( _( "For pain.001.001.03.ch.02, for non-ISR payments, " - "the BIC is required on the bank '%s' related to the " - "bank account '%s'" + "the BIC is required on the bank '%(name)s' related to the " + "bank account '%(account)s'", + name=partner_bank.bank_id.name, + account=partner_bank.acc_number, ) - % (partner_bank.bank_id.name, partner_bank.acc_number) ) return super().generate_party_agent( parent_node, @@ -175,5 +176,6 @@ def generate_remittance_info_block(self, parent_node, line, gen_args): creditor_ref_info_type_code.text = "QRR" creditor_reference = etree.SubElement(creditor_ref_information, "Ref") creditor_reference.text = line.payment_line_ids[0].communication + return True else: - super().generate_remittance_info_block(parent_node, line, gen_args) + return super().generate_remittance_info_block(parent_node, line, gen_args) diff --git a/setup/l10n_ch_pain_base/odoo/addons/l10n_ch_pain_base b/setup/l10n_ch_pain_base/odoo/addons/l10n_ch_pain_base new file mode 120000 index 000000000..836809e69 --- /dev/null +++ b/setup/l10n_ch_pain_base/odoo/addons/l10n_ch_pain_base @@ -0,0 +1 @@ +../../../../l10n_ch_pain_base \ No newline at end of file diff --git a/setup/l10n_ch_pain_base/setup.py b/setup/l10n_ch_pain_base/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/l10n_ch_pain_base/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From c9e3f7e69b874cc6750ebf03a8fffdff9ec1257b Mon Sep 17 00:00:00 2001 From: BT-anieto Date: Tue, 11 Jun 2024 16:24:56 +0200 Subject: [PATCH 28/28] [MIG] l10n_ch_pain_base: Migration to 16.0 Remove dependency on l10n_ch_base_bank since it is obsolete. Add check for partner bank QR reference --- l10n_ch_pain_base/__manifest__.py | 4 +- l10n_ch_pain_base/models/account_move_line.py | 8 +- .../models/account_payment_line.py | 12 +-- .../models/account_payment_order.py | 90 +------------------ l10n_ch_pain_base/readme/CONTRIBUTORS.rst | 1 + 5 files changed, 8 insertions(+), 107 deletions(-) diff --git a/l10n_ch_pain_base/__manifest__.py b/l10n_ch_pain_base/__manifest__.py index 7614c05ea..47735df3a 100644 --- a/l10n_ch_pain_base/__manifest__.py +++ b/l10n_ch_pain_base/__manifest__.py @@ -5,12 +5,12 @@ { "name": "Switzerland - ISO 20022", "summary": "ISO 20022 base module for Switzerland", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Finance", "website": "https://github.com/OCA/l10n-switzerland", "author": "Akretion,Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": ["account_banking_pain_base", "l10n_ch_base_bank"], + "depends": ["account_banking_pain_base"], "data": ["views/account_payment_line.xml"], "installable": True, } diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index a9bda5d40..4ce27e267 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -12,13 +12,9 @@ def _prepare_payment_line_vals(self, payment_order): if ( self.move_id and self.move_id._has_isr_ref() - and self.move_id.partner_bank_id + and self.move_id.partner_bank_id.l10n_ch_qr_iban ): - if self.move_id.partner_bank_id._is_qr_iban(): - vals["communication_type"] = "qrr" - else: - vals["local_instrument"] = "CH01" - vals["communication_type"] = "isr" + vals["communication_type"] = "qrr" if vals["communication"]: vals["communication"] = vals["communication"].replace(" ", "") return vals diff --git a/l10n_ch_pain_base/models/account_payment_line.py b/l10n_ch_pain_base/models/account_payment_line.py index a1d65ca41..b5696234f 100644 --- a/l10n_ch_pain_base/models/account_payment_line.py +++ b/l10n_ch_pain_base/models/account_payment_line.py @@ -7,15 +7,7 @@ class AccountPaymentLine(models.Model): _inherit = "account.payment.line" - local_instrument = fields.Selection( - selection_add=[("CH01", "CH01 (ISR)")], ondelete={"CH01": "set null"} - ) communication_type = fields.Selection( - selection_add=[("isr", "ISR"), ("qrr", "QRR")], - ondelete={"isr": "set default", "qrr": "set default"}, + selection_add=[("qrr", "QRR")], + ondelete={"qrr": "set default"}, ) - - def invoice_reference_type2communication_type(self): - res = super().invoice_reference_type2communication_type() - res["isr"] = "isr" - return res diff --git a/l10n_ch_pain_base/models/account_payment_order.py b/l10n_ch_pain_base/models/account_payment_order.py index 59f518b05..8e7500849 100644 --- a/l10n_ch_pain_base/models/account_payment_order.py +++ b/l10n_ch_pain_base/models/account_payment_order.py @@ -3,8 +3,7 @@ from lxml import etree -from odoo import _, api, models -from odoo.exceptions import UserError +from odoo import api, models class AccountPaymentOrder(models.Model): @@ -71,93 +70,6 @@ def generate_start_payment_info_block( gen_args, ) - @api.model - def generate_party_agent( - self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None - ): - if gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" and bank_line: - if bank_line.payment_line_ids[:1].local_instrument == "CH01": - # Don't set the creditor agent on ISR/CH01 payments - return True - elif not partner_bank.bank_bic: - raise UserError( - _( - "For pain.001.001.03.ch.02, for non-ISR payments, " - "the BIC is required on the bank '%(name)s' related to the " - "bank account '%(account)s'", - name=partner_bank.bank_id.name, - account=partner_bank.acc_number, - ) - ) - return super().generate_party_agent( - parent_node, - party_type, - order, - partner_bank, - gen_args, - bank_line=bank_line, - ) - - @api.model - def generate_party_acc_number( - self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None - ): - if ( - gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" - and bank_line - and bank_line.payment_line_ids[:1].local_instrument == "CH01" - ): - if not partner_bank.l10n_ch_postal: - raise UserError( - _( - "The field 'Postal account' is not set on the bank " - "account '%s'." - ) - % partner_bank.acc_number - ) - party_account = etree.SubElement(parent_node, "%sAcct" % party_type) - party_account_id = etree.SubElement(party_account, "Id") - 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.l10n_ch_postal - return True - else: - return super().generate_party_acc_number( - parent_node, - party_type, - order, - partner_bank, - gen_args, - bank_line=bank_line, - ) - - @api.model - def generate_address_block(self, parent_node, partner, gen_args): - """Generate the piece of the XML corresponding to PstlAdr""" - if partner.country_id: - postal_address = etree.SubElement(parent_node, "PstlAdr") - - 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 or partner.street2: - adrline1 = etree.SubElement(postal_address, "AdrLine") - adrline1.text = ", ".join( - filter(None, [partner.street, partner.street2]) - ) - - if partner.zip and partner.city: - adrline2 = etree.SubElement(postal_address, "AdrLine") - adrline2.text = " ".join([partner.zip, partner.city]) - - return True - @api.model def generate_remittance_info_block(self, parent_node, line, gen_args): if line.payment_line_ids[:1].communication_type == "qrr": diff --git a/l10n_ch_pain_base/readme/CONTRIBUTORS.rst b/l10n_ch_pain_base/readme/CONTRIBUTORS.rst index 4f35f64a5..f5ed57aa7 100644 --- a/l10n_ch_pain_base/readme/CONTRIBUTORS.rst +++ b/l10n_ch_pain_base/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Alexis de Lattre * Denis Leemann * Mykhailo Panarin +* Alberto Nieto