diff --git a/account_banking_sepa_credit_transfer/README.rst b/account_banking_sepa_credit_transfer/README.rst new file mode 100644 index 000000000..746559822 --- /dev/null +++ b/account_banking_sepa_credit_transfer/README.rst @@ -0,0 +1,95 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +==================================== +Account Banking SEPA Credit Transfer +==================================== + +Module to export payment orders in SEPA XML file format. + +SEPA PAIN (PAyment INitiation) is the new european standard for +Customer-to-Bank payment instructions. This module implements SEPA Credit +Transfer (SCT), more specifically PAIN versions 001.001.02, 001.001.03, +001.001.04 and 001.001.05. It is part of the ISO 20022 standard, available on +https://www.iso20022.org. + +The Implementation Guidelines for SEPA Credit Transfer published by the +European Payments Council (https://www.europeanpaymentscouncil.eu) use +PAIN version 001.001.03, so it's probably the version of PAIN that you should +try first. + +It also includes pain.001.003.03 which is used in Germany instead of 001.001.03. +You can read more about this here (only in german language): +http://www.ebics.de/startseite/ + +Installation +============ + +This module depends on : +* account_banking_pain_base + +This module is part of the OCA/bank-payment suite. + +Configuration +============= + +* Create a Payment Mode dedicated to SEPA Credit Transfer. + +* Select the Payment Method *SEPA Credit Transfer to suppliers* (which is + automatically created upon module installation). + +* Check that this payment method uses the proper version of PAIN. + +Usage +===== + +In the menu *Invoicing/Accounting > Payments > Payment Order*, create a new +payment order and select the Payment Mode dedicated to SEPA Credit +Transfer that you created during the configuration step. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/173/11.0 + +Known issues / Roadmap +====================== + + * No known issues + +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 +* Pedro M. Baeza +* Stéphane Bidoul +* Stefan Rijnhart +* Julien Laloux +* Alexandre Fayolle +* Raphaël Valyi +* Erwin van der Ploeg +* Sandy Carter +* Antonio Espinosa + +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/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/__init__.py new file mode 100644 index 000000000..a1815ae51 --- /dev/null +++ b/account_banking_sepa_credit_transfer/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import models +from .post_install import update_bank_journals diff --git a/account_banking_sepa_credit_transfer/__manifest__.py b/account_banking_sepa_credit_transfer/__manifest__.py new file mode 100644 index 000000000..decd94359 --- /dev/null +++ b/account_banking_sepa_credit_transfer/__manifest__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# © 2010-2016 Akretion (www.akretion.com) +# © 2014 Tecnativa - Pedro M. Baeza +# © 2016 Tecnativa - Antonio Espinosa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Account Banking SEPA Credit Transfer', + 'summary': 'Create SEPA XML files for Credit Transfers', + 'version': '11.0.1.0.0', + 'license': 'AGPL-3', + 'author': "Akretion, " + "Tecnativa, " + "Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/bank-payment', + 'category': 'Banking addons', + 'conflicts': ['account_sepa'], + 'depends': ['account_banking_pain_base'], + 'data': [ + 'data/account_payment_method.xml', + ], + 'demo': [ + 'demo/sepa_credit_transfer_demo.xml' + ], + 'post_init_hook': 'update_bank_journals', + 'installable': True, +} diff --git a/account_banking_sepa_credit_transfer/data/account_payment_method.xml b/account_banking_sepa_credit_transfer/data/account_payment_method.xml new file mode 100644 index 000000000..515314b5a --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/account_payment_method.xml @@ -0,0 +1,14 @@ + + + + + + SEPA Credit Transfer to suppliers + sepa_credit_transfer + outbound + + pain.001.001.03 + + + + diff --git a/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd new file mode 100644 index 000000000..43529da1b --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd @@ -0,0 +1,784 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd new file mode 100644 index 000000000..864977991 --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd @@ -0,0 +1,921 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd new file mode 100644 index 000000000..813c7fe29 --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd new file mode 100644 index 000000000..18bd0cc7c --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd @@ -0,0 +1,931 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_credit_transfer/data/pain.001.003.03.xsd b/account_banking_sepa_credit_transfer/data/pain.001.003.03.xsd new file mode 100644 index 000000000..0c3b51e32 --- /dev/null +++ b/account_banking_sepa_credit_transfer/data/pain.001.003.03.xsd @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + If used, it is recommended to be used at ‘Payment Information’ level and not at ‘Credit Transfer Transaction Information’ level. + + + + + + It is recommended that this element be specified at ‘Payment Information’ level. + + + + + This data element may be present either at ‘Payment Information’ or at ‘Credit Transfer Transaction Information’ level. + + + + + + + + + + + + + + + + If a Creditor Reference contains a check digit, the receiving bank is not required to validate this. +If the receiving bank validates the check digit and if this validation fails, the bank may continue its processing and send the transaction to the next party in the chain. +RF Creditor Reference may be used (ISO 11649). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Either ‘BIC or BEI’ or one +occurrence of ‘Other’ is allowed. + + + + + Either ‘Date and Place of Birth’ or one occurrence of ‘Other’ is allowed. + + + + + + + + + + ‘Name’ is limited to 70 characters +in length. + + + + + + + + + + ‘Name’ is limited to 70 characters +in length. + + + + + + + + + + + + + + + + + + Only ‘TRF’ is allowed. + + + + + If present and contains ‘true’, batch booking is requested. If present and contains ‘false’, booking per transaction is requested. If element is not present, pre-agreed customer-to-bank conditions apply. + + + + + + + If used, it is recommended to be used only at ‘Payment Information’ level and not at Credit Transfer Transaction Information’ level. +When Instruction Priority is to be used, ‘Payment Type Information’ must be present at ‘Payment Information’ level. + + + + + + + + + This data element may be present either at ‘Payment Information’ or at ‘Credit Transfer Transaction Information’ level. + + + + + It is recommended that this element be specified at ‘Payment Information’ level. + + + + + + + + + + + + + + + If present, pre-agreed customer-to-bank conditions apply. + + + + + + Depending on the agreement between the Originator and the Originator Bank, ‘Category Purpose’ may be forwarded to the Beneficiary Bank. + + + + + + + + + + Depending on the agreement between the Originator and the Originator Bank, ‘Category Purpose’ may be forwarded to the Beneficiary Bank. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only codes from the ISO 20022 ExternalPurposeCode list are allowed. + + + + + + + + + + + + + + + + + + + + + + When present, the receiving bank is not obliged to validate the the reference information. + + + + + + + + + + diff --git a/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml new file mode 100644 index 000000000..c11d6ff76 --- /dev/null +++ b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml @@ -0,0 +1,24 @@ + + + + + + SEPA Credit Transfer to suppliers + + variable + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_credit_transfer/i18n/de.po b/account_banking_sepa_credit_transfer/i18n/de.po new file mode 100644 index 000000000..82ff31167 --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/de.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# Niki Waibel, 2016 +# Niki Waibel, 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: Niki Waibel\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "Das Bankkonto fehlt auf der Zahlungszeile des Partners '%s' (Referenz '%s')." + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "PAIN Version '%s' wird nicht unterstützt." + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Líneas de pago" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "Zahlungsmethoden" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Zahlungsauftrag" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "SEPA-Überweisung an Zulieferer" diff --git a/account_banking_sepa_credit_transfer/i18n/es.po b/account_banking_sepa_credit_transfer/i18n/es.po new file mode 100644 index 000000000..8045f040c --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/es.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# OCA Transbot , 2016 +# Pedro M. Baeza , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "Falta la cuenta bancaria en la línea de pago de la empresa '%s' (referencia '%s')." + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "La versión PAIN '%s' no está soportada." + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Líneas de pago" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "Métodos de pago" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Orden de pago" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "Transferencia de crédito SEPA para proveedores" diff --git a/account_banking_sepa_credit_transfer/i18n/fr.po b/account_banking_sepa_credit_transfer/i18n/fr.po new file mode 100644 index 000000000..f59704ad2 --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/fr.po @@ -0,0 +1,181 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-08 00:46+0000\n" +"PO-Revision-Date: 2016-04-06 00:15+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-bank-payment-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: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:199 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,batch_booking:0 +msgid "Batch Booking" +msgstr "Débit groupé" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "Supportés par le destinataire" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "Supportés par l'émetteur" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Cancel" +msgstr "Annuler" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,charge_bearer:0 +msgid "Charge Bearer" +msgstr "Répartition des frais" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Create" +msgstr "Créer" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard +msgid "Export SEPA Credit Transfer File" +msgstr "Exporte le fichier de virement SEPA" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,file:0 +msgid "File" +msgstr "Fichier" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,filename:0 +msgid "Filename" +msgstr "Nom du fichier" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Finish" +msgstr "Finir" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Following Service Level" +msgstr "Suivant le niveau de service" + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa.wizard,charge_bearer:0 +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must" +" use this). Shared : transaction charges on the debtor side are to be borne " +"by the debtor, transaction charges on the creditor side are to be borne by " +"the creditor. Borne by creditor : all transaction charges are to be borne by" +" the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "Suivant le niveau de service : la répartition des frais bancaires suit les règles pré-établies dans le schema ou dans le contrat avec la banque (les messages SEPA Core doivent utiliser ce paramètre). Partagés : les frais bancaires côté débiteur sont à la charge du débiteur, les frais bancaires côté créancier sont à la charge du créancier. Supportés par le créancier : tous les frais bancaires sont à la charge du créancier. Supportés par le débiteur : tous les frais bancaires sont à la charge du débiteur." + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Generate" +msgstr "Générer" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: help:banking.export.sepa.wizard,batch_booking:0 +msgid "" +"If true, the bank statement will display only one debit line for all the " +"wire transfers of the SEPA XML file ; if false, the bank statement will " +"display one debit line per wire transfer of the SEPA XML file." +msgstr "Si coché, le relevé de compte ne comportera qu'une ligne de débit pour tous les virements du fichier SEPA XML ; si non coché, le relevé de compte comportera une ligne de débit pour chaque virement du fichier SEPA XML." + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "Nombre de transactions" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_payment_mode +msgid "Payment Mode" +msgstr "Mode de paiement" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Ordres de paiement" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:98 +#, python-format +msgid "" +"Payment Type Code '%s' is not supported. The only Payment Type Codes " +"supported for SEPA Credit Transfers are 'pain.001.001.02', " +"'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05' and " +"'pain.001.003.03'." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "SEPA File Generation" +msgstr "Génération du fichier SEPA" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Shared" +msgstr "Partagé" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,state:0 +msgid "State" +msgstr "État" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Validate" +msgstr "Valider" diff --git a/account_banking_sepa_credit_transfer/i18n/hr.po b/account_banking_sepa_credit_transfer/i18n/hr.po new file mode 100644 index 000000000..e903483fc --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/hr.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 00:10+0000\n" +"PO-Revision-Date: 2016-10-19 23:45+0000\n" +"Last-Translator: <>\n" +"Language-Team: Croatian (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Stavke plaćanja" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "Metode plaćanja" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Nalog za plaćanje" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "" diff --git a/account_banking_sepa_credit_transfer/i18n/nb_NO.po b/account_banking_sepa_credit_transfer/i18n/nb_NO.po new file mode 100644 index 000000000..2d479d7fb --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/nb_NO.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# Imre Kristoffer Eilertsen , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-30 07:37+0000\n" +"PO-Revision-Date: 2016-07-30 07:37+0000\n" +"Last-Translator: Imre Kristoffer Eilertsen , 2016\n" +"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/teams/23907/nb_NO/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nb_NO\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:146 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Betalingsordre" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "" diff --git a/account_banking_sepa_credit_transfer/i18n/nl.po b/account_banking_sepa_credit_transfer/i18n/nl.po new file mode 100644 index 000000000..eb0516ed9 --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/nl.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# Erwin van der Ploeg , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "Bankrekening ontbreekt op de betaalregel van relatie '%s' (reference '%s')." + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "PAIN versie '%s' is niet ondersteund." + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Betaalregels" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "Betaalwijzes" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Betalingsopdracht" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "SEPA overboeking naar leveranciers" diff --git a/account_banking_sepa_credit_transfer/i18n/pt_BR.po b/account_banking_sepa_credit_transfer/i18n/pt_BR.po new file mode 100644 index 000000000..97c04ce11 --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/pt_BR.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "Conta bancária está faltando na linha de pagamento do parceiro '%s' (ref. '%s')." + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Linhas do pagamento" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Ordem de Pagamento" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "" diff --git a/account_banking_sepa_credit_transfer/i18n/sl.po b/account_banking_sepa_credit_transfer/i18n/sl.po new file mode 100644 index 000000000..5ec145b1b --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/sl.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (10.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-01 01:24+0000\n" +"PO-Revision-Date: 2017-05-29 20:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-payment-10-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:149 +#, python-format +msgid "" +"Bank account is missing on the bank payment line of partner '%s' (reference " +"'%s')." +msgstr "Pri postavki bančnega plačila partnerja '%s' (sklic '%s') manjka bančni račun." + +#. module: account_banking_sepa_credit_transfer +#: code:addons/account_banking_sepa_credit_transfer/models/account_payment_order.py:60 +#, python-format +msgid "PAIN version '%s' is not supported." +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_line +msgid "Payment Lines" +msgstr "Plačilne postavke" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_method +msgid "Payment Methods" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "Plačilni nalog" + +#. module: account_banking_sepa_credit_transfer +#: model:account.payment.method,name:account_banking_sepa_credit_transfer.sepa_credit_transfer +#: model:account.payment.mode,name:account_banking_sepa_credit_transfer.payment_mode_outbound_sepa_ct1 +msgid "SEPA Credit Transfer to suppliers" +msgstr "" diff --git a/account_banking_sepa_credit_transfer/models/__init__.py b/account_banking_sepa_credit_transfer/models/__init__.py new file mode 100644 index 000000000..3475860d2 --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import account_payment_method +from . import account_payment_order +from . import account_payment_line diff --git a/account_banking_sepa_credit_transfer/models/account_payment_line.py b/account_banking_sepa_credit_transfer/models/account_payment_line.py new file mode 100644 index 000000000..4800b255a --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/account_payment_line.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class AccountPaymentLine(models.Model): + _inherit = 'account.payment.line' + + # local_instrument 'INST' used for instant credit transfers + # which will begin on November 21st 2017, cf + # https://www.europeanpaymentscouncil.eu/document-library/ + # rulebooks/2017-sepa-instant-credit-transfer-rulebook + local_instrument = fields.Selection( + selection_add=[('INST', 'Instant Transfer')]) diff --git a/account_banking_sepa_credit_transfer/models/account_payment_method.py b/account_banking_sepa_credit_transfer/models/account_payment_method.py new file mode 100644 index 000000000..54d061e49 --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/account_payment_method.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields, api + + +class AccountPaymentMethod(models.Model): + _inherit = 'account.payment.method' + + pain_version = fields.Selection(selection_add=[ + ('pain.001.001.02', 'pain.001.001.02'), + ('pain.001.001.03', 'pain.001.001.03 ' + '(recommended for credit transfer)'), + ('pain.001.001.04', 'pain.001.001.04'), + ('pain.001.001.05', 'pain.001.001.05'), + ('pain.001.003.03', 'pain.001.003.03 (credit transfer in Germany)'), + ]) + + @api.multi + def get_xsd_file_path(self): + self.ensure_one() + if self.pain_version in [ + 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04', + 'pain.001.001.05', 'pain.001.003.03']: + path = 'account_banking_sepa_credit_transfer/data/%s.xsd'\ + % self.pain_version + return path + return super(AccountPaymentMethod, self).get_xsd_file_path() diff --git a/account_banking_sepa_credit_transfer/models/account_payment_order.py b/account_banking_sepa_credit_transfer/models/account_payment_order.py new file mode 100644 index 000000000..f39f046e3 --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/account_payment_order.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +# © 2010-2016 Akretion (www.akretion.com) +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import models, api, _ +from odoo.exceptions import UserError +from lxml import etree + + +class AccountPaymentOrder(models.Model): + _inherit = 'account.payment.order' + + @api.multi + def generate_payment_file(self): + """Creates the SEPA Credit Transfer file. That's the important code!""" + self.ensure_one() + if self.payment_method_id.code != 'sepa_credit_transfer': + return super(AccountPaymentOrder, self).generate_payment_file() + + pain_flavor = self.payment_method_id.pain_version + # We use pain_flavor.startswith('pain.001.001.xx') + # to support country-specific extensions such as + # pain.001.001.03.ch.02 (cf l10n_ch_sepa) + if not pain_flavor: + raise UserError( + _("PAIN version '%s' is not supported.") % pain_flavor) + if pain_flavor.startswith('pain.001.001.02'): + bic_xml_tag = 'BIC' + name_maxsize = 70 + root_xml_tag = 'pain.001.001.02' + elif pain_flavor.startswith('pain.001.001.03'): + bic_xml_tag = 'BIC' + # size 70 -> 140 for with pain.001.001.03 + # BUT the European Payment Council, in the document + # "SEPA Credit Transfer Scheme Customer-to-bank + # Implementation guidelines" v6.0 available on + # http://www.europeanpaymentscouncil.eu/knowledge_bank.cfm + # says that 'Nm' should be limited to 70 + # so we follow the "European Payment Council" + # and we put 70 and not 140 + name_maxsize = 70 + root_xml_tag = 'CstmrCdtTrfInitn' + elif pain_flavor.startswith('pain.001.001.04'): + bic_xml_tag = 'BICFI' + name_maxsize = 140 + root_xml_tag = 'CstmrCdtTrfInitn' + elif pain_flavor.startswith('pain.001.001.05'): + bic_xml_tag = 'BICFI' + name_maxsize = 140 + root_xml_tag = 'CstmrCdtTrfInitn' + # added pain.001.003.03 for German Banks + # it is not in the offical ISO 20022 documentations, but nearly all + # german banks are working with this instead 001.001.03 + elif pain_flavor == 'pain.001.003.03': + bic_xml_tag = 'BIC' + name_maxsize = 70 + root_xml_tag = 'CstmrCdtTrfInitn' + else: + raise UserError( + _("PAIN version '%s' is not supported.") % pain_flavor) + xsd_file = self.payment_method_id.get_xsd_file_path() + gen_args = { + 'bic_xml_tag': bic_xml_tag, + 'name_maxsize': name_maxsize, + 'convert_to_ascii': self.payment_method_id.convert_to_ascii, + 'payment_method': 'TRF', + 'file_prefix': 'sct_', + 'pain_flavor': pain_flavor, + 'pain_xsd_file': xsd_file, + } + nsmap = self.generate_pain_nsmap() + attrib = self.generate_pain_attrib() + xml_root = etree.Element('Document', nsmap=nsmap, attrib=attrib) + pain_root = etree.SubElement(xml_root, root_xml_tag) + # A. Group header + group_header, nb_of_transactions_a, control_sum_a = \ + self.generate_group_header_block(pain_root, gen_args) + transactions_count_a = 0 + amount_control_sum_a = 0.0 + lines_per_group = {} + # key = (requested_date, priority, local_instrument, categ_purpose) + # values = list of lines as object + for line in self.bank_line_ids: + priority = line.priority + local_instrument = line.local_instrument + categ_purpose = line.category_purpose + # The field line.date is the requested payment date + # taking into account the 'date_prefered' setting + # cf account_banking_payment_export/models/account_payment.py + # in the inherit of action_open() + key = (line.date, priority, local_instrument, categ_purpose) + if key in lines_per_group: + lines_per_group[key].append(line) + else: + lines_per_group[key] = [line] + for (requested_date, priority, local_instrument, categ_purpose),\ + lines in list(lines_per_group.items()): + # B. Payment info + payment_info, nb_of_transactions_b, control_sum_b = \ + self.generate_start_payment_info_block( + pain_root, + "self.name + '-' " + "+ requested_date.replace('-', '') + '-' + priority + " + "'-' + local_instrument + '-' + category_purpose", + priority, local_instrument, categ_purpose, + False, requested_date, { + 'self': self, + 'priority': priority, + 'requested_date': requested_date, + 'local_instrument': local_instrument or 'NOinstr', + 'category_purpose': categ_purpose or 'NOcateg', + }, gen_args) + self.generate_party_block( + payment_info, 'Dbtr', 'B', + self.company_partner_bank_id, gen_args) + charge_bearer = etree.SubElement(payment_info, 'ChrgBr') + if self.sepa: + charge_bearer_text = 'SLEV' + else: + charge_bearer_text = self.charge_bearer + charge_bearer.text = charge_bearer_text + transactions_count_b = 0 + amount_control_sum_b = 0.0 + for line in lines: + transactions_count_a += 1 + transactions_count_b += 1 + # C. Credit Transfer Transaction Info + credit_transfer_transaction_info = etree.SubElement( + payment_info, 'CdtTrfTxInf') + payment_identification = etree.SubElement( + credit_transfer_transaction_info, 'PmtId') + end2end_identification = etree.SubElement( + payment_identification, 'EndToEndId') + end2end_identification.text = self._prepare_field( + 'End to End Identification', 'line.name', + {'line': line}, 35, gen_args=gen_args) + currency_name = self._prepare_field( + 'Currency Code', 'line.currency_id.name', + {'line': line}, 3, gen_args=gen_args) + amount = etree.SubElement( + credit_transfer_transaction_info, 'Amt') + instructed_amount = etree.SubElement( + amount, 'InstdAmt', Ccy=currency_name) + instructed_amount.text = '%.2f' % line.amount_currency + amount_control_sum_a += line.amount_currency + amount_control_sum_b += line.amount_currency + if not line.partner_bank_id: + raise UserError( + _("Bank account is missing on the bank payment line " + "of partner '%s' (reference '%s').") + % (line.partner_id.name, line.name)) + self.generate_party_block( + credit_transfer_transaction_info, 'Cdtr', + 'C', line.partner_bank_id, gen_args, line) + self.generate_remittance_info_block( + credit_transfer_transaction_info, line, gen_args) + if not pain_flavor.startswith('pain.001.001.02'): + nb_of_transactions_b.text = str(transactions_count_b) + control_sum_b.text = '%.2f' % amount_control_sum_b + if not pain_flavor.startswith('pain.001.001.02'): + nb_of_transactions_a.text = str(transactions_count_a) + control_sum_a.text = '%.2f' % amount_control_sum_a + else: + nb_of_transactions_a.text = str(transactions_count_a) + control_sum_a.text = '%.2f' % amount_control_sum_a + return self.finalize_sepa_file_creation(xml_root, gen_args) diff --git a/account_banking_sepa_credit_transfer/post_install.py b/account_banking_sepa_credit_transfer/post_install.py new file mode 100644 index 000000000..b7c219e27 --- /dev/null +++ b/account_banking_sepa_credit_transfer/post_install.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, SUPERUSER_ID + + +def update_bank_journals(cr, registry): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + ajo = env['account.journal'] + journals = ajo.search([('type', '=', 'bank')]) + sct = env.ref( + 'account_banking_sepa_credit_transfer.sepa_credit_transfer') + if sct: + journals.write({ + 'outbound_payment_method_ids': [(4, sct.id)], + }) + return diff --git a/account_banking_sepa_credit_transfer/static/description/icon.png b/account_banking_sepa_credit_transfer/static/description/icon.png new file mode 100644 index 000000000..e1485aabd Binary files /dev/null and b/account_banking_sepa_credit_transfer/static/description/icon.png differ diff --git a/account_banking_sepa_credit_transfer/static/description/icon.svg b/account_banking_sepa_credit_transfer/static/description/icon.svg new file mode 100644 index 000000000..266ef8442 --- /dev/null +++ b/account_banking_sepa_credit_transfer/static/description/icon.svg @@ -0,0 +1,92 @@ + + + +image/svg+xmlCREDITTRANSFER + \ No newline at end of file diff --git a/account_banking_sepa_credit_transfer/tests/__init__.py b/account_banking_sepa_credit_transfer/tests/__init__.py new file mode 100644 index 000000000..97a8c4298 --- /dev/null +++ b/account_banking_sepa_credit_transfer/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import test_sct diff --git a/account_banking_sepa_credit_transfer/tests/test_sct.py b/account_banking_sepa_credit_transfer/tests/test_sct.py new file mode 100644 index 000000000..51b785347 --- /dev/null +++ b/account_banking_sepa_credit_transfer/tests/test_sct.py @@ -0,0 +1,274 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +import base64 +from odoo.addons.account.tests.account_test_classes import AccountingTestCase +from odoo.exceptions import UserError +from odoo.tools import float_compare +import time +from lxml import etree + + +class TestSCT(AccountingTestCase): + + def setUp(self): + super(TestSCT, self).setUp() + self.account_model = self.env['account.account'] + self.move_model = self.env['account.move'] + self.journal_model = self.env['account.journal'] + self.payment_order_model = self.env['account.payment.order'] + self.payment_line_model = self.env['account.payment.line'] + self.bank_line_model = self.env['bank.payment.line'] + self.partner_bank_model = self.env['res.partner.bank'] + self.attachment_model = self.env['ir.attachment'] + self.invoice_model = self.env['account.invoice'] + self.invoice_line_model = self.env['account.invoice.line'] + self.main_company = self.env.ref('base.main_company') + self.partner_agrolait = self.env.ref('base.res_partner_2') + self.partner_asus = self.env.ref('base.res_partner_1') + self.partner_c2c = self.env.ref('base.res_partner_12') + self.account_expense = self.account_model.search([( + 'user_type_id', + '=', + self.env.ref('account.data_account_type_expenses').id)], limit=1) + self.account_payable = self.account_model.search([( + 'user_type_id', + '=', + self.env.ref('account.data_account_type_payable').id)], limit=1) + # create journal + self.bank_journal = self.journal_model.create({ + 'name': 'Company Bank journal', + 'type': 'bank', + 'code': 'BNKFB', + 'bank_account_id': + self.env.ref('account_payment_mode.main_company_iban').id, + 'bank_id': + self.env.ref('account_payment_mode.bank_la_banque_postale').id, + }) + # update payment mode + self.payment_mode = self.env.ref( + 'account_banking_sepa_credit_transfer.' + 'payment_mode_outbound_sepa_ct1') + self.payment_mode.write({ + 'bank_account_link': 'fixed', + 'fixed_journal_id': self.bank_journal.id, + }) + self.eur_currency = self.env.ref('base.EUR') + self.usd_currency = self.env.ref('base.USD') + self.main_company.currency_id = self.eur_currency.id + # Trigger the recompute of account type on res.partner.bank + for bank_acc in self.partner_bank_model.search([]): + bank_acc.acc_number = bank_acc.acc_number + + def test_no_pain(self): + self.payment_mode.payment_method_id.pain_version = False + with self.assertRaises(UserError): + self.check_eur_currency_sct() + + def test_pain_001_03(self): + self.payment_mode.payment_method_id.pain_version = 'pain.001.001.03' + self.check_eur_currency_sct() + + def test_pain_001_04(self): + self.payment_mode.payment_method_id.pain_version = 'pain.001.001.04' + self.check_eur_currency_sct() + + def test_pain_001_05(self): + self.payment_mode.payment_method_id.pain_version = 'pain.001.001.05' + self.check_eur_currency_sct() + + def test_pain_003_03(self): + self.payment_mode.payment_method_id.pain_version = 'pain.001.003.03' + self.check_eur_currency_sct() + + def check_eur_currency_sct(self): + invoice1 = self.create_invoice( + self.partner_agrolait.id, + 'account_payment_mode.res_partner_2_iban', self.eur_currency.id, + 42.0, 'F1341') + invoice2 = self.create_invoice( + self.partner_agrolait.id, + 'account_payment_mode.res_partner_2_iban', self.eur_currency.id, + 12.0, 'F1342') + invoice3 = self.create_invoice( + self.partner_agrolait.id, + 'account_payment_mode.res_partner_2_iban', self.eur_currency.id, + 5.0, 'A1301', 'in_refund') + invoice4 = self.create_invoice( + self.partner_c2c.id, + 'account_payment_mode.res_partner_12_iban', self.eur_currency.id, + 11.0, 'I1642') + invoice5 = self.create_invoice( + self.partner_c2c.id, + 'account_payment_mode.res_partner_12_iban', self.eur_currency.id, + 41.0, 'I1643') + for inv in [invoice1, invoice2, invoice3, invoice4, invoice5]: + action = inv.create_account_payment_line() + self.assertEqual(action['res_model'], 'account.payment.order') + self.payment_order = self.payment_order_model.browse(action['res_id']) + self.assertEqual( + self.payment_order.payment_type, 'outbound') + self.assertEqual( + self.payment_order.payment_mode_id, self.payment_mode) + self.assertEqual( + self.payment_order.journal_id, self.bank_journal) + pay_lines = self.payment_line_model.search([ + ('partner_id', '=', self.partner_agrolait.id), + ('order_id', '=', self.payment_order.id)]) + self.assertEqual(len(pay_lines), 3) + agrolait_pay_line1 = pay_lines[0] + accpre = self.env['decimal.precision'].precision_get('Account') + self.assertEqual(agrolait_pay_line1.currency_id, self.eur_currency) + self.assertEqual( + agrolait_pay_line1.partner_bank_id, invoice1.partner_bank_id) + self.assertEqual(float_compare( + agrolait_pay_line1.amount_currency, 42, precision_digits=accpre), + 0) + self.assertEqual(agrolait_pay_line1.communication_type, 'normal') + self.assertEqual(agrolait_pay_line1.communication, 'F1341') + self.payment_order.draft2open() + self.assertEqual(self.payment_order.state, 'open') + self.assertEqual(self.payment_order.sepa, True) + bank_lines = self.bank_line_model.search([ + ('partner_id', '=', self.partner_agrolait.id)]) + self.assertEqual(len(bank_lines), 1) + agrolait_bank_line = bank_lines[0] + self.assertEqual(agrolait_bank_line.currency_id, self.eur_currency) + self.assertEqual(float_compare( + agrolait_bank_line.amount_currency, 49.0, precision_digits=accpre), + 0) + self.assertEqual(agrolait_bank_line.communication_type, 'normal') + self.assertEqual( + agrolait_bank_line.communication, 'F1341-F1342-A1301') + self.assertEqual( + agrolait_bank_line.partner_bank_id, invoice1.partner_bank_id) + + action = self.payment_order.open2generated() + self.assertEqual(self.payment_order.state, 'generated') + self.assertEqual(action['res_model'], 'ir.attachment') + attachment = self.attachment_model.browse(action['res_id']) + self.assertEqual(attachment.datas_fname[-4:], '.xml') + xml_file = base64.b64decode(attachment.datas) + xml_root = etree.fromstring(xml_file) + namespaces = xml_root.nsmap + namespaces['p'] = xml_root.nsmap[None] + namespaces.pop(None) + pay_method_xpath = xml_root.xpath( + '//p:PmtInf/p:PmtMtd', namespaces=namespaces) + self.assertEqual(pay_method_xpath[0].text, 'TRF') + sepa_xpath = xml_root.xpath( + '//p:PmtInf/p:PmtTpInf/p:SvcLvl/p:Cd', namespaces=namespaces) + self.assertEqual(sepa_xpath[0].text, 'SEPA') + debtor_acc_xpath = xml_root.xpath( + '//p:PmtInf/p:DbtrAcct/p:Id/p:IBAN', namespaces=namespaces) + self.assertEqual( + debtor_acc_xpath[0].text, + self.payment_order.company_partner_bank_id.sanitized_acc_number) + self.payment_order.generated2uploaded() + self.assertEqual(self.payment_order.state, 'uploaded') + for inv in [invoice1, invoice2, invoice3, invoice4, invoice5]: + self.assertEqual(inv.state, 'paid') + return + + def test_usd_currency_sct(self): + invoice1 = self.create_invoice( + self.partner_asus.id, + 'account_payment_mode.res_partner_2_iban', self.usd_currency.id, + 2042.0, 'Inv9032') + invoice2 = self.create_invoice( + self.partner_asus.id, + 'account_payment_mode.res_partner_2_iban', self.usd_currency.id, + 1012.0, 'Inv9033') + for inv in [invoice1, invoice2]: + action = inv.create_account_payment_line() + self.assertEqual(action['res_model'], 'account.payment.order') + self.payment_order = self.payment_order_model.browse(action['res_id']) + self.assertEqual( + self.payment_order.payment_type, 'outbound') + self.assertEqual( + self.payment_order.payment_mode_id, self.payment_mode) + self.assertEqual( + self.payment_order.journal_id, self.bank_journal) + pay_lines = self.payment_line_model.search([ + ('partner_id', '=', self.partner_asus.id), + ('order_id', '=', self.payment_order.id)]) + self.assertEqual(len(pay_lines), 2) + asus_pay_line1 = pay_lines[0] + accpre = self.env['decimal.precision'].precision_get('Account') + self.assertEqual(asus_pay_line1.currency_id, self.usd_currency) + self.assertEqual( + asus_pay_line1.partner_bank_id, invoice1.partner_bank_id) + self.assertEqual(float_compare( + asus_pay_line1.amount_currency, 2042, precision_digits=accpre), + 0) + self.assertEqual(asus_pay_line1.communication_type, 'normal') + self.assertEqual(asus_pay_line1.communication, 'Inv9032') + self.payment_order.draft2open() + self.assertEqual(self.payment_order.state, 'open') + self.assertEqual(self.payment_order.sepa, False) + bank_lines = self.bank_line_model.search([ + ('partner_id', '=', self.partner_asus.id)]) + self.assertEqual(len(bank_lines), 1) + asus_bank_line = bank_lines[0] + self.assertEqual(asus_bank_line.currency_id, self.usd_currency) + self.assertEqual(float_compare( + asus_bank_line.amount_currency, 3054.0, precision_digits=accpre), + 0) + self.assertEqual(asus_bank_line.communication_type, 'normal') + self.assertEqual( + asus_bank_line.communication, 'Inv9032-Inv9033') + self.assertEqual( + asus_bank_line.partner_bank_id, invoice1.partner_bank_id) + + action = self.payment_order.open2generated() + self.assertEqual(self.payment_order.state, 'generated') + self.assertEqual(action['res_model'], 'ir.attachment') + attachment = self.attachment_model.browse(action['res_id']) + self.assertEqual(attachment.datas_fname[-4:], '.xml') + xml_file = base64.b64decode(attachment.datas) + xml_root = etree.fromstring(xml_file) + namespaces = xml_root.nsmap + namespaces['p'] = xml_root.nsmap[None] + namespaces.pop(None) + pay_method_xpath = xml_root.xpath( + '//p:PmtInf/p:PmtMtd', namespaces=namespaces) + self.assertEqual(pay_method_xpath[0].text, 'TRF') + sepa_xpath = xml_root.xpath( + '//p:PmtInf/p:PmtTpInf/p:SvcLvl/p:Cd', namespaces=namespaces) + self.assertEqual(len(sepa_xpath), 0) + debtor_acc_xpath = xml_root.xpath( + '//p:PmtInf/p:DbtrAcct/p:Id/p:IBAN', namespaces=namespaces) + self.assertEqual( + debtor_acc_xpath[0].text, + self.payment_order.company_partner_bank_id.sanitized_acc_number) + self.payment_order.generated2uploaded() + self.assertEqual(self.payment_order.state, 'uploaded') + for inv in [invoice1, invoice2]: + self.assertEqual(inv.state, 'paid') + return + + def create_invoice( + self, partner_id, partner_bank_xmlid, currency_id, + price_unit, reference, type='in_invoice'): + invoice = self.invoice_model.create({ + 'partner_id': partner_id, + 'reference_type': 'none', + 'reference': reference, + 'currency_id': currency_id, + 'name': 'test', + 'account_id': self.account_payable.id, + 'type': type, + 'date_invoice': time.strftime('%Y-%m-%d'), + 'payment_mode_id': self.payment_mode.id, + 'partner_bank_id': self.env.ref(partner_bank_xmlid).id, + }) + self.invoice_line_model.create({ + 'invoice_id': invoice.id, + 'price_unit': price_unit, + 'quantity': 1, + 'name': 'Great service', + 'account_id': self.account_expense.id, + }) + invoice.action_invoice_open() + return invoice