diff --git a/account_banking_sepa_direct_debit/__init__.py b/account_banking_sepa_direct_debit/__init__.py
index e2b93a535..ec29ab8d6 100644
--- a/account_banking_sepa_direct_debit/__init__.py
+++ b/account_banking_sepa_direct_debit/__init__.py
@@ -1,2 +1,3 @@
from . import models
+from . import wizards
from .post_install import update_bank_journals
diff --git a/account_banking_sepa_direct_debit/__manifest__.py b/account_banking_sepa_direct_debit/__manifest__.py
index 5f2dd2131..7fc6bf591 100644
--- a/account_banking_sepa_direct_debit/__manifest__.py
+++ b/account_banking_sepa_direct_debit/__manifest__.py
@@ -1,20 +1,20 @@
-# Copyright 2013-2016 Akretion (www.akretion.com)
-# Copyright 2014-2018 Tecnativa - Pedro M. Baeza
-# Copyright 2016 Tecnativa - Antonio Espinosa
+# Copyright 2013-2020 Akretion (www.akretion.com)
+# Copyright 2014-2020 Tecnativa - Pedro M. Baeza & Antonio Espinosa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Account Banking SEPA Direct Debit",
"summary": "Create SEPA files for Direct Debit",
- "version": "13.0.1.0.2",
+ "version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Akretion, " "Tecnativa, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/bank-payment",
"category": "Banking addons",
"depends": ["account_banking_pain_base", "account_banking_mandate"],
+ "external_dependencies": {"python": ["stdnum"]},
"data": [
"views/account_banking_mandate_view.xml",
- "views/res_config.xml",
+ "views/res_config_settings.xml",
"views/account_payment_mode.xml",
"data/mandate_expire_cron.xml",
"data/account_payment_method.xml",
diff --git a/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml
index 70783ef80..af823ee39 100644
--- a/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml
+++ b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml
@@ -1,6 +1,6 @@
diff --git a/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml
index d794e855a..c22f68416 100644
--- a/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml
+++ b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml
@@ -6,15 +6,12 @@
variable
-
+ FR78ZZZ424242
-
+
-
+
\n"
"Language-Team: none\n"
"Language: es_AR\n"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.3.2\n"
+"X-Generator: Weblate 3.10\n"
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
@@ -118,11 +118,10 @@ msgid ""
" THE DEBTOR WILL BE ABLE TO MANAGE THE MENTIONED AUTHORIZATION THROUGH THE MEANS PROVIDED BY HIS BANK."
msgstr ""
"TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE. UNA VEZ FIRMADA "
-"ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA.\n"
-" LA ENTIDAD DE DEUDOR REQUIERE AUTORIZACIÓN DE "
-"ÉSTE PREVIA AL CARGO EN CUENTA DE LOS ADEUDOS DIRECTOS B2B.\n"
-" EL DEUDOR PODRÁ GESTIONAR DICHA AUTORIZACIÓN "
-"CON LOS MEDIOS QUE SU ENTIDAD PONGA A SU DISPOSICIÓN."
+"ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA.LA "
+"ENTIDAD DE DEUDOR REQUIERE AUTORIZACIÓN DE ÉSTE PREVIA AL CARGO EN CUENTA DE "
+"LOS ADEUDOS DIRECTOS B2B.EL DEUDOR PODRÁ GESTIONAR DICHA AUTORIZACIÓN CON "
+"LOS MEDIOS QUE SU ENTIDAD PONGA A SU DISPOSICIÓN."
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
@@ -132,12 +131,11 @@ msgid ""
" with your bank.\n"
" A refund must be claimed within 8 weeks starting from the date on which your account was debited."
msgstr ""
-"Como parte de sus derechos, el deudor está legitimado al reembolso\n"
-" por su entidad en los términos y condiciones del "
-"contrato suscrito\n"
-" con la misma.\n"
-" La solicitud de reembolso deberá efectuarse "
-"dentro de las ocho semanas que siguen a la fecha de adeudo en cuenta."
+"Como parte de sus derechos, el deudor está legitimado al reembolso por su "
+"entidad en los términos y condiciones del contrato suscrito con la misma. La "
+"solicitud de reembolso deberá efectuarse dentro de las ocho semanas que "
+"siguen a la fecha de adeudo en cuenta. Puede obtener información adicional "
+"sobre sus derechos en su entidad financiera."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
@@ -203,8 +201,7 @@ msgid ""
"- a country-specific identifier"
msgstr ""
"Introduzca el identificador de acreedor que se le ha atribuido a su compañía "
-"para realizar adeudos directos SEPA. Su banco suele poseer esta información."
-"\n"
+"para realizar adeudos directos SEPA. Su banco suele poseer esta información. "
"Este identificador se compone de:\n"
"- el código ISO de 2 letras de su país\n"
"- dos dígitos de comprobación\n"
@@ -426,13 +423,11 @@ msgid ""
" not to debit your account up until the day on which the payment is due."
msgstr ""
"Esta orden de domiciliación está prevista para operaciones exclusivamente "
-"entre empresas y/o autónomos.\n"
-" El deudor no tiene derecho a que su entidad le "
-"reembolse una vez que se haya realizado\n"
-" el cargo en cuenta, pero puede solicitar a su "
-"entidad que no efectúe el adeudo en la cuenta hasta la fecha debida.\n"
-" Podrá obtener información detallada del "
-"procedimiento en su entidad financiera."
+"entre empresas y/o autónomos. El deudor no tiene derecho a que su entidad le "
+"reembolse una vez que se haya realizado el cargo en cuenta, pero puede "
+"solicitar a su entidad que no efectúe el adeudo en la cuenta hasta la fecha "
+"debida. Podrá obtener información detallada del procedimiento en su entidad "
+"financiera."
#. module: account_banking_sepa_direct_debit
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
@@ -492,6 +487,5 @@ msgid ""
" debit your account in accordance with the instructions from"
msgstr ""
"a enviar instrucciones a la entidad del deudor para adeudar su cuenta y (B) "
-"a la entidad \n"
-" para efectuar los adeudos en su cuenta siguiendo "
-"las instrucciones del acreedor"
+"a la entidad para efectuar los adeudos en su cuenta siguiendo las "
+"instrucciones del acreedor"
diff --git a/account_banking_sepa_direct_debit/models/__init__.py b/account_banking_sepa_direct_debit/models/__init__.py
index 5413d1ae3..3a13c7d5b 100644
--- a/account_banking_sepa_direct_debit/models/__init__.py
+++ b/account_banking_sepa_direct_debit/models/__init__.py
@@ -1,5 +1,4 @@
from . import res_company
-from . import res_config
from . import account_banking_mandate
from . import bank_payment_line
from . import account_payment_mode
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 b9e3e0863..80113fc80 100644
--- a/account_banking_sepa_direct_debit/models/account_banking_mandate.py
+++ b/account_banking_sepa_direct_debit/models/account_banking_mandate.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2016 Akretion - Alexis de Lattre
+# Copyright 2020 Akretion - Alexis de Lattre
# Copyright 2014 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
@@ -19,14 +19,20 @@ class AccountBankingMandate(models.Model):
_inherit = "account.banking.mandate"
_rec_name = "display_name"
- format = fields.Selection(selection_add=[("sepa", "Sepa Mandate")], default="sepa")
+ format = fields.Selection(
+ selection_add=[("sepa", "Sepa Mandate")],
+ default="sepa",
+ ondelete={"sepa": "set default"},
+ )
type = fields.Selection(
- selection_add=[("recurrent", "Recurrent"), ("oneoff", "One-Off")]
+ selection_add=[("recurrent", "Recurrent"), ("oneoff", "One-Off")],
+ default="recurrent",
+ ondelete={"recurrent": "set null", "oneoff": "set null"},
)
recurrent_sequence_type = fields.Selection(
[("first", "First"), ("recurring", "Recurring"), ("final", "Final")],
string="Sequence Type for Next Debit",
- track_visibility="onchange",
+ tracking=70,
help="This field is only used for Recurrent mandates, not for "
"One-Off mandates.",
default="first",
@@ -35,7 +41,7 @@ class AccountBankingMandate(models.Model):
[("CORE", "Basic (CORE)"), ("B2B", "Enterprise (B2B)")],
string="Scheme",
default="CORE",
- track_visibility="onchange",
+ tracking=80,
)
unique_mandate_reference = fields.Char(size=35) # cf ISO 20022
display_name = fields.Char(compute="_compute_display_name2", store=True)
@@ -61,47 +67,50 @@ class AccountBankingMandate(models.Model):
@api.onchange("partner_bank_id")
def mandate_partner_bank_change(self):
- for mandate in self:
- super(AccountBankingMandate, self).mandate_partner_bank_change()
- res = {}
- if (
- mandate.state == "valid"
- and mandate.partner_bank_id
- and mandate.type == "recurrent"
- and mandate.recurrent_sequence_type != "first"
- ):
- mandate.recurrent_sequence_type = "first"
- res["warning"] = {
- "title": _("Mandate update"),
- "message": _(
- "As you changed the bank account attached "
- "to this mandate, the 'Sequence Type' has "
- "been set back to 'First'."
- ),
- }
- return res
+ super().mandate_partner_bank_change()
+ res = {}
+ if (
+ self.state == "valid"
+ and self.partner_bank_id
+ and self.type == "recurrent"
+ and self.recurrent_sequence_type != "first"
+ ):
+ self.recurrent_sequence_type = "first"
+ res["warning"] = {
+ "title": _("Mandate update"),
+ "message": _(
+ "As you changed the bank account attached "
+ "to this mandate, the 'Sequence Type' has "
+ "been set back to 'First'."
+ ),
+ }
+ return res
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(
months=-NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY
)
- expire_limit_date_str = expire_limit_date.strftime("%Y-%m-%d")
expired_mandates = self.search(
[
"|",
("last_debit_date", "=", False),
- ("last_debit_date", "<=", expire_limit_date_str),
+ ("last_debit_date", "<=", expire_limit_date),
("state", "=", "valid"),
- ("signature_date", "<=", expire_limit_date_str),
+ ("signature_date", "<=", expire_limit_date),
]
)
if expired_mandates:
expired_mandates.write({"state": "expired"})
+ expired_mandates.message_post(
+ body=_(
+ "Mandate automatically set to expired after %d months without use."
+ )
+ % NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY
+ )
logger.info(
- "The following SDD Mandate IDs has been set to expired: %s"
- % expired_mandates.ids
+ "%d SDD Mandate set to expired: IDs %s"
+ % (len(expired_mandates), expired_mandates.ids)
)
else:
logger.info("0 SDD Mandates had to be set to Expired")
- return True
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 950dfa498..45191f500 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_line.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_line.py
@@ -9,7 +9,7 @@ class AccountPaymentLine(models.Model):
_inherit = "account.payment.line"
def draft2open_payment_line_check(self):
- res = super(AccountPaymentLine, self).draft2open_payment_line_check()
+ res = super().draft2open_payment_line_check()
sepa_dd_lines = self.filtered(
lambda l: l.order_id.payment_method_id.code == "sepa_direct_debit"
)
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 9086975d1..ab048504a 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_method.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_method.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Akretion (Alexis de Lattre )
+# Copyright 2020 Akretion (Alexis de Lattre )
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
@@ -13,7 +13,13 @@ class AccountPaymentMethod(models.Model):
("pain.008.001.03", "pain.008.001.03"),
("pain.008.001.04", "pain.008.001.04"),
("pain.008.003.02", "pain.008.003.02 (direct debit in Germany)"),
- ]
+ ],
+ ondelete={
+ "pain.008.001.02": "set null",
+ "pain.008.001.03": "set null",
+ "pain.008.001.04": "set null",
+ "pain.008.003.02": "set null",
+ },
)
def get_xsd_file_path(self):
@@ -26,4 +32,4 @@ class AccountPaymentMethod(models.Model):
]:
path = "account_banking_sepa_direct_debit/data/%s.xsd" % self.pain_version
return path
- return super(AccountPaymentMethod, self).get_xsd_file_path()
+ return super().get_xsd_file_path()
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 621fa7675..8d3d306b4 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_mode.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_mode.py
@@ -1,11 +1,11 @@
# Copyright 2016 Tecnativa - Antonio Espinosa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from stdnum.eu.at_02 import is_valid
+
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
-from .common import is_sepa_creditor_identifier_valid
-
class AccountPaymentMode(models.Model):
_inherit = "account.payment.mode"
@@ -26,11 +26,8 @@ class AccountPaymentMode(models.Model):
@api.constrains("sepa_creditor_identifier")
def _check_sepa_creditor_identifier(self):
for payment_mode in self:
- if payment_mode.sepa_creditor_identifier:
- if not is_sepa_creditor_identifier_valid(
- payment_mode.sepa_creditor_identifier
- ):
- raise ValidationError(
- _("The SEPA Creditor Identifier '%s' is invalid.")
- % payment_mode.sepa_creditor_identifier
- )
+ ics = payment_mode.sepa_creditor_identifier
+ if ics and not is_valid(ics):
+ raise ValidationError(
+ _("The SEPA Creditor Identifier '%s' is invalid.") % ics
+ )
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 257014a3e..0e0704202 100644
--- a/account_banking_sepa_direct_debit/models/account_payment_order.py
+++ b/account_banking_sepa_direct_debit/models/account_payment_order.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Akretion (Alexis de Lattre )
+# Copyright 2020 Akretion (Alexis de Lattre )
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
@@ -15,7 +15,7 @@ class AccountPaymentOrder(models.Model):
"""Creates the SEPA Direct Debit file. That's the important code !"""
self.ensure_one()
if self.payment_method_id.code != "sepa_direct_debit":
- return super(AccountPaymentOrder, self).generate_payment_file()
+ return super().generate_payment_file()
pain_flavor = self.payment_method_id.pain_version
# We use pain_flavor.startswith('pain.008.001.xx')
# to support country-specific extensions such as
@@ -275,7 +275,7 @@ class AccountPaymentOrder(models.Model):
# from first to recurring, so that the account move
# is generated BEFORE, which will allow the split
# of the account move per sequence_type
- res = super(AccountPaymentOrder, self).generated2uploaded()
+ res = super().generated2uploaded()
abmo = self.env["account.banking.mandate"]
for order in self:
to_expire_mandates = abmo.browse([])
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 b1520d304..5c4e69073 100644
--- a/account_banking_sepa_direct_debit/models/bank_payment_line.py
+++ b/account_banking_sepa_direct_debit/models/bank_payment_line.py
@@ -1,4 +1,4 @@
-# Copyright 2015-2016 Akretion - Alexis de Lattre
+# Copyright 2020 Akretion - Alexis de Lattre
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models
@@ -15,6 +15,6 @@ class BankPaymentLine(models.Model):
So we split the transfer move lines by mandate type, so easier
reconciliation of the bank statement.
"""
- hashcode = super(BankPaymentLine, self).move_line_offsetting_account_hashcode()
+ hashcode = super().move_line_offsetting_account_hashcode()
hashcode += "-" + str(self.mandate_id.recurrent_sequence_type)
return hashcode
diff --git a/account_banking_sepa_direct_debit/models/common.py b/account_banking_sepa_direct_debit/models/common.py
deleted file mode 100644
index fc371a768..000000000
--- a/account_banking_sepa_direct_debit/models/common.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2013-2016 Akretion - Alexis de Lattre
-# Copyright 2014 Tecnativa - Pedro M. Baeza
-# Copyright 2016 Tecnativa - Antonio Espinosa
-# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-
-import logging
-
-logger = logging.getLogger(__name__)
-
-
-def is_sepa_creditor_identifier_valid(sepa_creditor_identifier):
- """Check if SEPA Creditor Identifier is valid
- @param sepa_creditor_identifier: SEPA Creditor Identifier as str
- or unicode
- @return: True if valid, False otherwise
- """
- if not isinstance(sepa_creditor_identifier, str):
- return False
- try:
- sci = str(sepa_creditor_identifier).lower()
- except Exception:
- logger.warning("SEPA Creditor ID should contain only ASCII characters.")
- return False
- if len(sci) < 9:
- return False
- before_replacement = sci[7:] + sci[0:2] + "00"
- logger.debug("SEPA ID check before_replacement = %s" % before_replacement)
- after_replacement = ""
- for char in before_replacement:
- if char.isalpha():
- after_replacement += str(ord(char) - 87)
- else:
- after_replacement += char
- logger.debug("SEPA ID check after_replacement = %s" % after_replacement)
- return int(sci[2:4]) == (98 - (int(after_replacement) % 97))
diff --git a/account_banking_sepa_direct_debit/models/res_company.py b/account_banking_sepa_direct_debit/models/res_company.py
index d5ab947b4..c72ec6dfb 100644
--- a/account_banking_sepa_direct_debit/models/res_company.py
+++ b/account_banking_sepa_direct_debit/models/res_company.py
@@ -3,11 +3,11 @@
# Copyright 2016 Tecnativa - Antonio Espinosa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from stdnum.eu.at_02 import is_valid
+
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
-from .common import is_sepa_creditor_identifier_valid
-
class ResCompany(models.Model):
_inherit = "res.company"
@@ -25,11 +25,8 @@ class ResCompany(models.Model):
@api.constrains("sepa_creditor_identifier")
def _check_sepa_creditor_identifier(self):
for company in self:
- if company.sepa_creditor_identifier:
- if not is_sepa_creditor_identifier_valid(
- company.sepa_creditor_identifier
- ):
- raise ValidationError(
- _("The SEPA Creditor Identifier '%s' is invalid.")
- % company.sepa_creditor_identifier
- )
+ ics = company.sepa_creditor_identifier
+ if ics and not is_valid(ics):
+ raise ValidationError(
+ _("The SEPA Creditor Identifier '%s' is invalid.") % ics
+ )
diff --git a/account_banking_sepa_direct_debit/readme/USAGE.rst b/account_banking_sepa_direct_debit/readme/USAGE.rst
index ebf2b1d3f..f53734b2f 100644
--- a/account_banking_sepa_direct_debit/readme/USAGE.rst
+++ b/account_banking_sepa_direct_debit/readme/USAGE.rst
@@ -1,3 +1,3 @@
-In the menu *Invoicing/Accounting > Payments > Debit Order*, create a new debit
+In the menu *Invoicing/Accounting > Customers > Debit Order*, create a new debit
order and select the Payment Mode dedicated to SEPA Direct Debit that
you created during the configuration step.
diff --git a/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml b/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml
index f8fd87a00..4586e8e23 100644
--- a/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml
+++ b/account_banking_sepa_direct_debit/reports/sepa_direct_debit_mandate.xml
@@ -13,18 +13,23 @@
-
+ SEPA Mandate
+ account.banking.mandate
+ qweb-pdf
+ account_banking_sepa_direct_debit.sepa_direct_debit_mandate
+ account_banking_sepa_direct_debit.sepa_direct_debit_mandate
+ 'Mandate-%s-%s' % (object.unique_mandate_reference, object.partner_id.name.replace(' ', '_')
+
diff --git a/account_banking_sepa_direct_debit/tests/__init__.py b/account_banking_sepa_direct_debit/tests/__init__.py
index f8b40c8bd..cc88935bb 100644
--- a/account_banking_sepa_direct_debit/tests/__init__.py
+++ b/account_banking_sepa_direct_debit/tests/__init__.py
@@ -1,2 +1,2 @@
-from . import test_sdd
+# from . import test_sdd # TODO port those tests
from . import test_mandate
diff --git a/account_banking_sepa_direct_debit/tests/test_mandate.py b/account_banking_sepa_direct_debit/tests/test_mandate.py
index ffdd8e611..09ad053be 100644
--- a/account_banking_sepa_direct_debit/tests/test_mandate.py
+++ b/account_banking_sepa_direct_debit/tests/test_mandate.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Akretion (Alexis de Lattre )
+# Copyright 2016-2020 Akretion (Alexis de Lattre )
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from dateutil.relativedelta import relativedelta
@@ -34,7 +34,7 @@ class TestMandate(TransactionCase):
self.assertEqual(self.mandate.state, "expired")
def setUp(self):
- res = super(TestMandate, self).setUp()
+ res = super().setUp()
self.partner = self.env.ref("base.res_partner_12")
bank_account = self.env.ref("account_payment_mode.res_partner_12_iban")
self.mandate = self.env["account.banking.mandate"].create(
diff --git a/account_banking_sepa_direct_debit/tests/test_sdd.py b/account_banking_sepa_direct_debit/tests/test_sdd.py
index fd00251a6..a7330c801 100644
--- a/account_banking_sepa_direct_debit/tests/test_sdd.py
+++ b/account_banking_sepa_direct_debit/tests/test_sdd.py
@@ -216,14 +216,14 @@ class TestSDDBase(TestAccountMultiCompanyNoChartCommon):
"partner_id": partner_id,
"reference_type": "none",
"currency_id": self.env.ref("base.EUR").id,
- "type": inv_type,
+ "move_type": inv_type,
"date": fields.Date.today(),
"payment_mode_id": self.payment_mode.id,
"mandate_id": mandate.id,
"invoice_line_ids": invoice_vals,
}
)
- invoice.post()
+ invoice.action_post()
return invoice
diff --git a/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml
index 2ba5e2f95..4c0395336 100644
--- a/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml
+++ b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml
@@ -18,17 +18,18 @@
attrs="{'invisible': [('format', '!=', 'sepa')],
'required': [('format', '=', 'sepa')]}"
/>
-
+
+ {'required': [('format', '=', 'sepa')]}
+
+
@@ -36,11 +37,30 @@
account.banking.mandate
-
-
-
-
+
+
+
+
+ type == 'recurrent'
+ type == 'oneoff'
+
+
+ format == 'sepa'
+
+
@@ -49,6 +69,7 @@
+
-
-
- sepa_direct_debit.account_config_settings.form
-
- res.config.settings
-
-
-
-