From f44d476aa13972ac5934b7ed13399d3d54f0a235 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mar=C3=A7al=20Isern?=
Date: Fri, 27 Mar 2020 07:49:53 +0100
Subject: [PATCH] [MIG] account_banking_sepa_direct_debit: Migration to 13.0
---
account_banking_sepa_direct_debit/README.rst | 11 +-
.../__manifest__.py | 2 +-
.../account_banking_sepa_direct_debit.pot | 140 ++++++++----------
.../models/account_banking_mandate.py | 6 +-
.../models/account_payment_line.py | 4 +-
.../models/account_payment_method.py | 3 +-
.../models/account_payment_mode.py | 1 -
.../models/account_payment_order.py | 4 +-
.../models/bank_payment_line.py | 3 +-
.../models/res_company.py | 1 -
.../readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 +-
.../tests/test_mandate.py | 4 +-
.../tests/test_sdd.py | 44 +++---
14 files changed, 106 insertions(+), 125 deletions(-)
diff --git a/account_banking_sepa_direct_debit/README.rst b/account_banking_sepa_direct_debit/README.rst
index 9e27232fa..fbac9519d 100644
--- a/account_banking_sepa_direct_debit/README.rst
+++ b/account_banking_sepa_direct_debit/README.rst
@@ -14,13 +14,13 @@ Account Banking SEPA Direct Debit
: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_direct_debit
+ :target: https://github.com/OCA/bank-payment/tree/13.0/account_banking_sepa_direct_debit
: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_direct_debit
+ :target: https://translation.odoo-community.org/projects/bank-payment-13-0/bank-payment-13-0-account_banking_sepa_direct_debit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/173/12.0
+ :target: https://runbot.odoo-community.org/runbot/173/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -98,7 +98,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -122,6 +122,7 @@ Contributors
* Sandy Carter
* Antonio Espinosa
* Sergio Teruel
+* Marçal Isern
Maintainers
~~~~~~~~~~~
@@ -136,6 +137,6 @@ 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.
+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_direct_debit/__manifest__.py b/account_banking_sepa_direct_debit/__manifest__.py
index a75def61a..4dec981a3 100644
--- a/account_banking_sepa_direct_debit/__manifest__.py
+++ b/account_banking_sepa_direct_debit/__manifest__.py
@@ -6,7 +6,7 @@
{
"name": "Account Banking SEPA Direct Debit",
"summary": "Create SEPA files for Direct Debit",
- "version": "12.0.1.2.0",
+ "version": "13.0.1.0.0",
"license": "AGPL-3",
"author": "Akretion, " "Tecnativa, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/bank-payment",
diff --git a/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot
index fdc96d081..f0c4eec56 100644
--- a/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot
+++ b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot
@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * account_banking_sepa_direct_debit
+# * account_banking_sepa_direct_debit
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 12.0\n"
+"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: <>\n"
+"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -100,34 +100,43 @@ msgstr ""
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
-msgid "ALL GAPS ARE MANDATORY. ONCE THIS MANDATE HAS BEEN SIGNED MUST BE SENT TO CREDITOR FOR STORAGE."
+msgid ""
+"ALL GAPS ARE MANDATORY. ONCE THIS MANDATE HAS BEEN SIGNED MUST BE SENT TO "
+"CREDITOR FOR STORAGE."
msgstr ""
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
-msgid "ALL GAPS ARE MANDATORY. ONCE THIS MANDATE HAS BEEN SIGNED MUST BE SENT TO CREDITOR FOR STORAGE.\n"
+msgid ""
+"ALL GAPS ARE MANDATORY. ONCE THIS MANDATE HAS BEEN SIGNED MUST BE SENT TO CREDITOR FOR STORAGE.\n"
" NEVERTHELESS, THE BANK OF DEBTOR REQUIRES DEBTOR’S AUTHORIZATION BEFORE DEBITING B2B DIRECT DEBITS IN THE ACCOUNT.\n"
" THE DEBTOR WILL BE ABLE TO MANAGE THE MENTIONED AUTHORIZATION THROUGH THE MEANS PROVIDED BY HIS BANK."
msgstr ""
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
-msgid "As part of your rights, you are entitled to a refund from\n"
+msgid ""
+"As part of your rights, you are entitled to a refund from\n"
" your bank under the terms and conditions of your agreement\n"
" with your bank.\n"
" A refund must be claimed within 8 weeks starting from the date on which your account was debited."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:76
+#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
#, python-format
-msgid "As you changed the bank account attached to this mandate, the 'Sequence Type' has been set back to 'First'."
+msgid ""
+"As you changed the bank account attached to this mandate, the 'Sequence "
+"Type' has been set back to 'First'."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:257
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:0
#, python-format
-msgid "Automatically switched from First to Recurring when the debit order %s has been marked as uploaded."
+msgid ""
+"Automatically switched from First to Recurring when the debit "
+"order %s has"
+" been marked as uploaded."
msgstr ""
#. module: account_banking_sepa_direct_debit
@@ -136,15 +145,10 @@ msgid "Bank Payment Lines"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,scheme:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__scheme__core
msgid "Basic (CORE)"
msgstr ""
-#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,format:0
-msgid "Basic Mandate"
-msgstr ""
-
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
msgid "By signing this mandate form, you authorise (A)"
@@ -167,7 +171,8 @@ msgstr ""
#. module: account_banking_sepa_direct_debit
#: model:ir.model.fields,help:account_banking_sepa_direct_debit.field_account_payment_mode__sepa_creditor_identifier
-msgid "Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. If not defined, SEPA Creditor Identifier from company will be used.\n"
+msgid ""
+"Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. If not defined, SEPA Creditor Identifier from company will be used.\n"
"This identifier is composed of :\n"
"- your country ISO code (2 letters)\n"
"- a 2-digits checkum\n"
@@ -178,7 +183,8 @@ msgstr ""
#. module: account_banking_sepa_direct_debit
#: model:ir.model.fields,help:account_banking_sepa_direct_debit.field_res_company__sepa_creditor_identifier
#: model:ir.model.fields,help:account_banking_sepa_direct_debit.field_res_config_settings__sepa_creditor_identifier
-msgid "Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. This identifier is composed of :\n"
+msgid ""
+"Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. This identifier is composed of :\n"
"- your country ISO code (2 letters)\n"
"- a 2-digits checkum\n"
"- a 3-letters business code\n"
@@ -186,27 +192,22 @@ msgid "Enter the Creditor Identifier that has been attributed to your company to
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,scheme:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__scheme__b2b
msgid "Enterprise (B2B)"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,recurrent_sequence_type:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__recurrent_sequence_type__final
msgid "Final"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,recurrent_sequence_type:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__recurrent_sequence_type__first
msgid "First"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,type:0
-msgid "Generic Mandate"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:85
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:0
#, python-format
msgid "Invalid mandate type in '%s'. Valid ones are 'Recurrent' or 'One-Off'"
msgstr ""
@@ -217,19 +218,21 @@ msgid "Mandate Format"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:75
+#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
#, python-format
msgid "Mandate update"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:28
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:0
#, python-format
-msgid "Missing SEPA Direct Debit mandate on the line with partner {partner_name} (reference {reference})."
+msgid ""
+"Missing SEPA Direct Debit mandate on the line with partner {partner_name} "
+"(reference {reference})."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,type:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__type__oneoff
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_search
msgid "One-Off"
@@ -261,20 +264,23 @@ msgid "Payment Order"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:41
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_order.py:0
#, python-format
-msgid "Payment Type Code '%s' is not supported. The only Payment Type Code supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and 'pain.008.001.04'."
+msgid ""
+"Payment Type Code '%s' is not supported. The only Payment Type Code "
+"supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and"
+" 'pain.008.001.04'."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,type:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__type__recurrent
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_search
msgid "Recurrent"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,recurrent_sequence_type:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__recurrent_sequence_type__recurring
msgid "Recurring"
msgstr ""
@@ -302,8 +308,8 @@ msgid "Scheme"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.banking.mandate,format:0
#: model:ir.actions.report,name:account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__format__sepa
msgid "Sepa Mandate"
msgstr ""
@@ -326,38 +332,45 @@ msgid "Set SEPA Direct Debit Mandates to Expired"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_mode.py:31
-#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:30
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_mode.py:0
+#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:0
#, python-format
msgid "The SEPA Creditor Identifier '%s' is invalid."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:33
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:0
#, python-format
-msgid "The SEPA Direct Debit mandate with reference {mandate_ref} for partner {partner_name} has expired."
+msgid ""
+"The SEPA Direct Debit mandate with reference {mandate_ref} for partner "
+"{partner_name} has expired."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:41
+#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:0
#, python-format
-msgid "The SEPA Direct Debit mandate with reference {mandate_ref} for partner {partner_name} has type set to 'One-Off' but has a last debit date set to {last_debit_date}. Therefore, it cannot be used."
+msgid ""
+"The SEPA Direct Debit mandate with reference {mandate_ref} for partner "
+"{partner_name} has type set to 'One-Off' but has a last debit date set to "
+"{last_debit_date}. Therefore, it cannot be used."
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:47
+#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
#, python-format
msgid "The recurrent mandate '%s' must have a sequence type."
msgstr ""
#. module: account_banking_sepa_direct_debit
#: model:ir.model.fields,help:account_banking_sepa_direct_debit.field_account_banking_mandate__recurrent_sequence_type
-msgid "This field is only used for Recurrent mandates, not for One-Off mandates."
+msgid ""
+"This field is only used for Recurrent mandates, not for One-Off mandates."
msgstr ""
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
-msgid "This mandate is only intended for business-to-business transactions.\n"
+msgid ""
+"This mandate is only intended for business-to-business transactions.\n"
" You are not entitled to a refund from your bank after your account has\n"
" been debited, but you are entitled to request your bank\n"
" not to debit your account up until the day on which the payment is due."
@@ -395,53 +408,28 @@ msgid "Write the ICS of your company"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
-msgid "pain.001.001.02"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
-msgid "pain.001.001.03 (recommended for credit transfer)"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
-msgid "pain.001.001.04"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
-msgid "pain.001.001.05"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
-msgid "pain.001.003.03 (credit transfer in Germany)"
-msgstr ""
-
-#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_payment_method__pain_version__pain_008_001_02
msgid "pain.008.001.02 (recommended for direct debit)"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_payment_method__pain_version__pain_008_001_03
msgid "pain.008.001.03"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_payment_method__pain_version__pain_008_001_04
msgid "pain.008.001.04"
msgstr ""
#. module: account_banking_sepa_direct_debit
-#: selection:account.payment.method,pain_version:0
+#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_payment_method__pain_version__pain_008_003_02
msgid "pain.008.003.02 (direct debit in Germany)"
msgstr ""
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
-msgid "to send instructions to your bank to debit your account and (B) your bank to\n"
+msgid ""
+"to send instructions to your bank to debit your account and (B) your bank to\n"
" debit your account in accordance with the instructions from"
msgstr ""
-
diff --git a/account_banking_sepa_direct_debit/models/account_banking_mandate.py b/account_banking_sepa_direct_debit/models/account_banking_mandate.py
index 888396686..b9e3e0863 100644
--- a/account_banking_sepa_direct_debit/models/account_banking_mandate.py
+++ b/account_banking_sepa_direct_debit/models/account_banking_mandate.py
@@ -40,7 +40,6 @@ class AccountBankingMandate(models.Model):
unique_mandate_reference = fields.Char(size=35) # cf ISO 20022
display_name = fields.Char(compute="_compute_display_name2", store=True)
- @api.multi
@api.constrains("type", "recurrent_sequence_type")
def _check_recurring_type(self):
for mandate in self:
@@ -50,18 +49,16 @@ class AccountBankingMandate(models.Model):
% mandate.unique_mandate_reference
)
- @api.multi
@api.depends("unique_mandate_reference", "recurrent_sequence_type")
def _compute_display_name2(self):
for mandate in self:
if mandate.format == "sepa":
mandate.display_name = "{} ({})".format(
- mandate.unique_mandate_reference, mandate.recurrent_sequence_type,
+ mandate.unique_mandate_reference, mandate.recurrent_sequence_type
)
else:
mandate.display_name = mandate.unique_mandate_reference
- @api.multi
@api.onchange("partner_bank_id")
def mandate_partner_bank_change(self):
for mandate in self:
@@ -84,7 +81,6 @@ class AccountBankingMandate(models.Model):
}
return res
- @api.model
def _sdd_mandate_set_state_to_expired(self):
logger.info("Searching for SDD Mandates that must be set to Expired")
expire_limit_date = datetime.today() + relativedelta(
diff --git a/account_banking_sepa_direct_debit/models/account_payment_line.py b/account_banking_sepa_direct_debit/models/account_payment_line.py
index 769d37cd6..950dfa498 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_line.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_line.py
@@ -1,14 +1,13 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from odoo import _, api, models
+from odoo import _, models
from odoo.exceptions import UserError
class AccountPaymentLine(models.Model):
_inherit = "account.payment.line"
- @api.multi
def draft2open_payment_line_check(self):
res = super(AccountPaymentLine, self).draft2open_payment_line_check()
sepa_dd_lines = self.filtered(
@@ -17,7 +16,6 @@ class AccountPaymentLine(models.Model):
sepa_dd_lines._check_sepa_direct_debit_ready()
return res
- @api.multi
def _check_sepa_direct_debit_ready(self):
"""
This method checks whether the payment line(s) are ready to be used
diff --git a/account_banking_sepa_direct_debit/models/account_payment_method.py b/account_banking_sepa_direct_debit/models/account_payment_method.py
index 93fc3d5ea..9086975d1 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_method.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_method.py
@@ -1,7 +1,7 @@
# Copyright 2016 Akretion (Alexis de Lattre )
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo import api, fields, models
+from odoo import fields, models
class AccountPaymentMethod(models.Model):
@@ -16,7 +16,6 @@ class AccountPaymentMethod(models.Model):
]
)
- @api.multi
def get_xsd_file_path(self):
self.ensure_one()
if self.pain_version in [
diff --git a/account_banking_sepa_direct_debit/models/account_payment_mode.py b/account_banking_sepa_direct_debit/models/account_payment_mode.py
index d8744df70..621fa7675 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_mode.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_mode.py
@@ -23,7 +23,6 @@ class AccountPaymentMode(models.Model):
"- a country-specific identifier",
)
- @api.multi
@api.constrains("sepa_creditor_identifier")
def _check_sepa_creditor_identifier(self):
for payment_mode in self:
diff --git a/account_banking_sepa_direct_debit/models/account_payment_order.py b/account_banking_sepa_direct_debit/models/account_payment_order.py
index 7ef5eadba..257014a3e 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_order.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_order.py
@@ -4,14 +4,13 @@
from lxml import etree
-from odoo import _, api, exceptions, fields, models
+from odoo import _, exceptions, fields, models
from odoo.exceptions import UserError
class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order"
- @api.multi
def generate_payment_file(self):
"""Creates the SEPA Direct Debit file. That's the important code !"""
self.ensure_one()
@@ -267,7 +266,6 @@ class AccountPaymentOrder(models.Model):
return self.finalize_sepa_file_creation(xml_root, gen_args)
- @api.multi
def generated2uploaded(self):
"""Write 'last debit date' on mandates
Set mandates from first to recurring
diff --git a/account_banking_sepa_direct_debit/models/bank_payment_line.py b/account_banking_sepa_direct_debit/models/bank_payment_line.py
index fb7646f4c..b1520d304 100644
--- a/account_banking_sepa_direct_debit/models/bank_payment_line.py
+++ b/account_banking_sepa_direct_debit/models/bank_payment_line.py
@@ -1,13 +1,12 @@
# Copyright 2015-2016 Akretion - Alexis de Lattre
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from odoo import api, models
+from odoo import models
class BankPaymentLine(models.Model):
_inherit = "bank.payment.line"
- @api.multi
def move_line_offsetting_account_hashcode(self):
"""
From my experience, even when you ask several direct debits
diff --git a/account_banking_sepa_direct_debit/models/res_company.py b/account_banking_sepa_direct_debit/models/res_company.py
index 346d66df2..d5ab947b4 100644
--- a/account_banking_sepa_direct_debit/models/res_company.py
+++ b/account_banking_sepa_direct_debit/models/res_company.py
@@ -22,7 +22,6 @@ class ResCompany(models.Model):
"identifier",
)
- @api.multi
@api.constrains("sepa_creditor_identifier")
def _check_sepa_creditor_identifier(self):
for company in self:
diff --git a/account_banking_sepa_direct_debit/readme/CONTRIBUTORS.rst b/account_banking_sepa_direct_debit/readme/CONTRIBUTORS.rst
index ec29073b0..0acc21d6f 100644
--- a/account_banking_sepa_direct_debit/readme/CONTRIBUTORS.rst
+++ b/account_banking_sepa_direct_debit/readme/CONTRIBUTORS.rst
@@ -6,3 +6,4 @@
* Sandy Carter
* Antonio Espinosa
* Sergio Teruel
+* Marçal Isern
diff --git a/account_banking_sepa_direct_debit/static/description/index.html b/account_banking_sepa_direct_debit/static/description/index.html
index 6d00ecb15..a9eb45a9b 100644
--- a/account_banking_sepa_direct_debit/static/description/index.html
+++ b/account_banking_sepa_direct_debit/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

Create SEPA files for Direct Debit
Module to export direct debit payment orders in SEPA XML file format.
SEPA PAIN (PAyment INitiation) is the new european standard for
@@ -444,7 +444,7 @@ you created during the configuration step.
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -476,7 +477,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
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.
+
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_direct_debit/tests/test_mandate.py b/account_banking_sepa_direct_debit/tests/test_mandate.py
index 61334ad87..ffdd8e611 100644
--- a/account_banking_sepa_direct_debit/tests/test_mandate.py
+++ b/account_banking_sepa_direct_debit/tests/test_mandate.py
@@ -4,13 +4,13 @@
from dateutil.relativedelta import relativedelta
from odoo import fields
-from odoo.exceptions import ValidationError
+from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase
class TestMandate(TransactionCase):
def test_contrains(self):
- with self.assertRaises(ValidationError):
+ with self.assertRaises(UserError):
self.mandate.recurrent_sequence_type = False
self.mandate.type = "recurrent"
self.mandate._check_recurring_type()
diff --git a/account_banking_sepa_direct_debit/tests/test_sdd.py b/account_banking_sepa_direct_debit/tests/test_sdd.py
index 06be52276..97de426d0 100644
--- a/account_banking_sepa_direct_debit/tests/test_sdd.py
+++ b/account_banking_sepa_direct_debit/tests/test_sdd.py
@@ -3,10 +3,10 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import base64
-import time
from lxml import etree
+from odoo import fields
from odoo.tests import common
from odoo.tools import float_compare
@@ -16,7 +16,6 @@ class TestSDD(common.HttpCase):
super(TestSDD, self).setUp()
self.company = self.env["res.company"]
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"]
@@ -24,8 +23,7 @@ class TestSDD(common.HttpCase):
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.invoice_model = self.env["account.move"]
self.partner_agrolait = self.env.ref("base.res_partner_2")
self.partner_c2c = self.env.ref("base.res_partner_12")
self.eur_currency = self.env.ref("base.EUR")
@@ -44,9 +42,11 @@ class TestSDD(common.HttpCase):
)
self.partner_agrolait.company_id = self.main_company.id
self.partner_c2c.company_id = self.main_company.id
+
self.env.ref(
"l10n_generic_coa.configurable_chart_template"
).try_loading_for_current_company()
+
self.account_revenue = self.account_model.search(
[
(
@@ -175,7 +175,7 @@ class TestSDD(common.HttpCase):
0,
)
self.assertEqual(agrolait_pay_line1.communication_type, "normal")
- self.assertEqual(agrolait_pay_line1.communication, invoice1.number)
+ self.assertEqual(agrolait_pay_line1.communication, invoice1.name)
payment_order.draft2open()
self.assertEqual(payment_order.state, "open")
self.assertEqual(payment_order.sepa, True)
@@ -193,7 +193,7 @@ class TestSDD(common.HttpCase):
0,
)
self.assertEqual(agrolait_bank_line.communication_type, "normal")
- self.assertEqual(agrolait_bank_line.communication, invoice1.number)
+ self.assertEqual(agrolait_bank_line.communication, invoice1.name)
self.assertEqual(agrolait_bank_line.mandate_id, invoice1.mandate_id)
self.assertEqual(
agrolait_bank_line.partner_bank_id, invoice1.mandate_id.partner_bank_id
@@ -202,7 +202,7 @@ class TestSDD(common.HttpCase):
self.assertEqual(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")
+ self.assertEqual(attachment.name[-4:], ".xml")
xml_file = base64.b64decode(attachment.datas)
xml_root = etree.fromstring(xml_file)
namespaces = xml_root.nsmap
@@ -224,32 +224,34 @@ class TestSDD(common.HttpCase):
payment_order.generated2uploaded()
self.assertEqual(payment_order.state, "uploaded")
for inv in [invoice1, invoice2]:
- self.assertEqual(inv.state, "paid")
+ self.assertEqual(inv.invoice_payment_state, "paid")
self.assertEqual(self.mandate2.recurrent_sequence_type, "recurring")
return
def create_invoice(self, partner_id, mandate, price_unit, type="out_invoice"):
+ invoice_vals = [
+ (
+ 0,
+ 0,
+ {
+ "name": "Great service",
+ "quantity": 1,
+ "account_id": self.account_revenue.id,
+ "price_unit": price_unit,
+ },
+ )
+ ]
invoice = self.invoice_model.create(
{
"partner_id": partner_id,
"reference_type": "none",
"currency_id": self.env.ref("base.EUR").id,
- "name": "test",
- "account_id": self.account_receivable.id,
"type": type,
- "date_invoice": time.strftime("%Y-%m-%d"),
+ "date": fields.Date.today(),
"payment_mode_id": self.payment_mode.id,
"mandate_id": mandate.id,
+ "invoice_line_ids": invoice_vals,
}
)
- self.invoice_line_model.create(
- {
- "invoice_id": invoice.id,
- "price_unit": price_unit,
- "quantity": 1,
- "name": "Great service",
- "account_id": self.account_revenue.id,
- }
- )
- invoice.action_invoice_open()
+ invoice.post()
return invoice