diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index 3d563021e..5c6a0580f 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -97,7 +97,7 @@ class AccountPaymentOrder(models.Model): '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] for unallowed_ascii_char in unallowed_ascii_chars: value = value.replace(unallowed_ascii_char, '-') - except: + except Exception: line = eval_ctx.get('line') if line: raise UserError( diff --git a/account_banking_pain_base/models/res_config_settings.py b/account_banking_pain_base/models/res_config_settings.py index 60d804969..f4e94ef79 100644 --- a/account_banking_pain_base/models/res_config_settings.py +++ b/account_banking_pain_base/models/res_config_settings.py @@ -9,11 +9,17 @@ class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' initiating_party_issuer = fields.Char( - related='company_id.initiating_party_issuer') + related='company_id.initiating_party_issuer', + readonly=False, + ) initiating_party_identifier = fields.Char( - related='company_id.initiating_party_identifier') + related='company_id.initiating_party_identifier', + readonly=False, + ) initiating_party_scheme = fields.Char( - related='company_id.initiating_party_scheme') + related='company_id.initiating_party_scheme', + readonly=False, + ) group_pain_multiple_identifier = fields.Boolean( string='Multiple identifiers', implied_group='account_banking_pain_base.' diff --git a/account_banking_sepa_credit_transfer/README.rst b/account_banking_sepa_credit_transfer/README.rst index 746559822..37e946297 100644 --- a/account_banking_sepa_credit_transfer/README.rst +++ b/account_banking_sepa_credit_transfer/README.rst @@ -1,10 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 - ==================================== Account Banking SEPA Credit Transfer ==================================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fbank--payment-lightgray.png?logo=github + :target: https://github.com/OCA/bank-payment/tree/12.0/account_banking_sepa_credit_transfer + :alt: OCA/bank-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/bank-payment-12-0/bank-payment-12-0-account_banking_sepa_credit_transfer + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/97/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + Module to export payment orders in SEPA XML file format. SEPA PAIN (PAyment INitiation) is the new european standard for @@ -22,6 +42,11 @@ 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/ +**Table of contents** + +.. contents:: + :local: + Installation ============ @@ -47,31 +72,29 @@ 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. +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 +* Tecnativa + Contributors ------------- +~~~~~~~~~~~~ * Alexis de Lattre -* Pedro M. Baeza * Stéphane Bidoul * Stefan Rijnhart * Julien Laloux @@ -79,17 +102,24 @@ Contributors * Raphaël Valyi * Erwin van der Ploeg * Sandy Carter -* Antonio Espinosa +* `Tecnativa `__: -Maintainer ----------- + * Antonio Espinosa + * Pedro M. Baeza + +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. -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/bank-payment `_ project on GitHub. -To contribute to this module, please visit https://odoo-community.org. +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/__init__.py index a1815ae51..24b65ee99 100644 --- a/account_banking_sepa_credit_transfer/__init__.py +++ b/account_banking_sepa_credit_transfer/__init__.py @@ -1,4 +1,3 @@ -# -*- 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 index decd94359..620e4e23d 100644 --- a/account_banking_sepa_credit_transfer/__manifest__.py +++ b/account_banking_sepa_credit_transfer/__manifest__.py @@ -1,13 +1,12 @@ -# -*- coding: utf-8 -*- -# © 2010-2016 Akretion (www.akretion.com) -# © 2014 Tecnativa - Pedro M. Baeza -# © 2016 Tecnativa - Antonio Espinosa +# Copyright 2010-2016 Akretion (www.akretion.com) +# Copyright 2016 Tecnativa - Antonio Espinosa +# Copyright 2014-2018 Tecnativa - Pedro M. Baeza # 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', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'author': "Akretion, " "Tecnativa, " diff --git a/account_banking_sepa_credit_transfer/models/__init__.py b/account_banking_sepa_credit_transfer/models/__init__.py index 3475860d2..137fca50c 100644 --- a/account_banking_sepa_credit_transfer/models/__init__.py +++ b/account_banking_sepa_credit_transfer/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import account_payment_method from . import account_payment_order diff --git a/account_banking_sepa_credit_transfer/models/account_payment_line.py b/account_banking_sepa_credit_transfer/models/account_payment_line.py index 4800b255a..a2fd57286 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_line.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_line.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2017 Akretion - Alexis de Lattre +# Copyright 2017 Akretion - Alexis de Lattre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/account_banking_sepa_credit_transfer/models/account_payment_method.py b/account_banking_sepa_credit_transfer/models/account_payment_method.py index 54d061e49..c093be50a 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_method.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_method.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Akretion (Alexis de Lattre ) +# Copyright 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api diff --git a/account_banking_sepa_credit_transfer/models/account_payment_order.py b/account_banking_sepa_credit_transfer/models/account_payment_order.py index df6ccba36..3a39862f4 100644 --- a/account_banking_sepa_credit_transfer/models/account_payment_order.py +++ b/account_banking_sepa_credit_transfer/models/account_payment_order.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- -# © 2010-2016 Akretion (www.akretion.com) -# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# Copyright 2010-2016 Akretion (www.akretion.com) +# Copyright 2014-2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, api, _ +from odoo import _, api, fields, models from odoo.exceptions import UserError from lxml import etree @@ -97,6 +96,7 @@ class AccountPaymentOrder(models.Model): for (requested_date, priority, local_instrument, categ_purpose),\ lines in list(lines_per_group.items()): # B. Payment info + requested_date = fields.Date.to_string(requested_date) payment_info, nb_of_transactions_b, control_sum_b = \ self.generate_start_payment_info_block( pain_root, diff --git a/account_banking_sepa_credit_transfer/post_install.py b/account_banking_sepa_credit_transfer/post_install.py index b7c219e27..5570a35e3 100644 --- a/account_banking_sepa_credit_transfer/post_install.py +++ b/account_banking_sepa_credit_transfer/post_install.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Akretion (Alexis de Lattre ) +# Copyright 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, SUPERUSER_ID diff --git a/account_banking_sepa_credit_transfer/readme/CONFIGURE.rst b/account_banking_sepa_credit_transfer/readme/CONFIGURE.rst new file mode 100644 index 000000000..05e8f3b89 --- /dev/null +++ b/account_banking_sepa_credit_transfer/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +* 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. diff --git a/account_banking_sepa_credit_transfer/readme/CONTRIBUTORS.rst b/account_banking_sepa_credit_transfer/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..6dd36e660 --- /dev/null +++ b/account_banking_sepa_credit_transfer/readme/CONTRIBUTORS.rst @@ -0,0 +1,12 @@ +* Alexis de Lattre +* Stéphane Bidoul +* Stefan Rijnhart +* Julien Laloux +* Alexandre Fayolle +* Raphaël Valyi +* Erwin van der Ploeg +* Sandy Carter +* `Tecnativa `__: + + * Antonio Espinosa + * Pedro M. Baeza diff --git a/account_banking_sepa_credit_transfer/readme/DESCRIPTION.rst b/account_banking_sepa_credit_transfer/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b03032d82 --- /dev/null +++ b/account_banking_sepa_credit_transfer/readme/DESCRIPTION.rst @@ -0,0 +1,16 @@ +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/ diff --git a/account_banking_sepa_credit_transfer/readme/INSTALL.rst b/account_banking_sepa_credit_transfer/readme/INSTALL.rst new file mode 100644 index 000000000..6c1bc3922 --- /dev/null +++ b/account_banking_sepa_credit_transfer/readme/INSTALL.rst @@ -0,0 +1,4 @@ +This module depends on : +* account_banking_pain_base + +This module is part of the OCA/bank-payment suite. diff --git a/account_banking_sepa_credit_transfer/readme/USAGE.rst b/account_banking_sepa_credit_transfer/readme/USAGE.rst new file mode 100644 index 000000000..cdd729aed --- /dev/null +++ b/account_banking_sepa_credit_transfer/readme/USAGE.rst @@ -0,0 +1,3 @@ +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. diff --git a/account_banking_sepa_credit_transfer/static/description/index.html b/account_banking_sepa_credit_transfer/static/description/index.html new file mode 100644 index 000000000..3705cf20e --- /dev/null +++ b/account_banking_sepa_credit_transfer/static/description/index.html @@ -0,0 +1,468 @@ + + + + + + +Account Banking SEPA Credit Transfer + + + +
+

Account Banking SEPA Credit Transfer

+ + +

Beta License: AGPL-3 OCA/bank-payment Translate me on Weblate Try me on Runbot

+

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/

+

Table of contents

+ +
+

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.

+
+
+

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
  • +
  • Tecnativa
  • +
+
+
+

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/bank-payment project on GitHub.

+

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

+
+
+
+ + diff --git a/account_banking_sepa_credit_transfer/tests/__init__.py b/account_banking_sepa_credit_transfer/tests/__init__.py index 97a8c4298..8b95a582a 100644 --- a/account_banking_sepa_credit_transfer/tests/__init__.py +++ b/account_banking_sepa_credit_transfer/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- 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 index 06678bfcb..f2547d5b2 100644 --- a/account_banking_sepa_credit_transfer/tests/test_sct.py +++ b/account_banking_sepa_credit_transfer/tests/test_sct.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Akretion (Alexis de Lattre ) # Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). @@ -12,8 +11,6 @@ from lxml import etree class TestSCT(common.HttpCase): - post_install = True - at_install = False def setUp(self): super(TestSCT, self).setUp() @@ -36,6 +33,9 @@ class TestSCT(common.HttpCase): 'name': 'Test EUR company', 'currency_id': self.eur_currency.id, }) + self.partner_agrolait.company_id = self.main_company.id + self.partner_asus.company_id = self.main_company.id + self.partner_c2c.company_id = self.main_company.id self.env.user.write({ 'company_ids': [(6, 0, self.main_company.ids)], 'company_id': self.main_company.id, @@ -82,8 +82,7 @@ class TestSCT(common.HttpCase): 'fixed_journal_id': self.bank_journal.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 + self.partner_bank_model.search([])._compute_acc_type() def test_no_pain(self): self.payment_mode.payment_method_id.pain_version = False diff --git a/account_payment_partner/models/account_invoice.py b/account_payment_partner/models/account_invoice.py index 791ea10ff..95622bcb4 100644 --- a/account_payment_partner/models/account_invoice.py +++ b/account_payment_partner/models/account_invoice.py @@ -117,6 +117,14 @@ class AccountInvoice(models.Model): _("The company of the invoice %s does not match " "with that of the payment mode") % rec.name) + @api.constrains('partner_id', 'partner_bank_id') + def validate_partner_bank_id(self): + """Inhibit the validation of the bank account by default, as core + rules are not the expected one for the bank-payment suite. + """ + if self.env.context.get('use_old_partner_bank_id_check'): + super().validate_partner_bank_id() + def partner_banks_to_show(self): self.ensure_one() if self.partner_bank_id: