[MIG] account_banking_sepa_direct_debit: Migration to 13.0

This commit is contained in:
Marçal Isern
2020-03-27 07:49:53 +01:00
committed by Reyes4711
parent d6ee39b32e
commit f44d476aa1
14 changed files with 106 additions and 125 deletions

View File

@@ -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 <https://github.com/OCA/bank-payment/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 <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_sepa_direct_debit%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_sepa_direct_debit%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -122,6 +122,7 @@ Contributors
* Sandy Carter
* Antonio Espinosa <antonioea@antiun.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Marçal Isern <marsal.isern@qubiq.es>
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 <https://github.com/OCA/bank-payment/tree/12.0/account_banking_sepa_direct_debit>`_ project on GitHub.
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/13.0/account_banking_sepa_direct_debit>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -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",

View File

@@ -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 DEBTORS 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 <b>First</b> to <b>Recurring</b> when the debit order <a href=# data-oe-model=account.payment.order data-oe-id=%d>%s</a> has been marked as uploaded."
msgid ""
"Automatically switched from <b>First</b> to <b>Recurring</b> when the debit "
"order <a href=# data-oe-model=account.payment.order data-oe-id=%d>%s</a> 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 ""

View File

@@ -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(

View File

@@ -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

View File

@@ -1,7 +1,7 @@
# Copyright 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# 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 [

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -6,3 +6,4 @@
* Sandy Carter
* Antonio Espinosa <antonioea@antiun.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Marçal Isern <marsal.isern@qubiq.es>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-payment/tree/12.0/account_banking_sepa_direct_debit"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-payment-12-0/bank-payment-12-0-account_banking_sepa_direct_debit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/173/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-payment/tree/13.0/account_banking_sepa_direct_debit"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-payment-13-0/bank-payment-13-0-account_banking_sepa_direct_debit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/173/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Create SEPA files for Direct Debit</p>
<p>Module to export direct debit payment orders in SEPA XML file format.</p>
<p>SEPA PAIN (PAyment INitiation) is the new european standard for
@@ -444,7 +444,7 @@ you created during the configuration step.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-payment/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_sepa_direct_debit%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_sepa_direct_debit%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -467,6 +467,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Sandy Carter</li>
<li>Antonio Espinosa &lt;<a class="reference external" href="mailto:antonioea&#64;antiun.com">antonioea&#64;antiun.com</a>&gt;</li>
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
<li>Marçal Isern &lt;<a class="reference external" href="mailto:marsal.isern&#64;qubiq.es">marsal.isern&#64;qubiq.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -476,7 +477,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-payment/tree/12.0/account_banking_sepa_direct_debit">OCA/bank-payment</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-payment/tree/13.0/account_banking_sepa_direct_debit">OCA/bank-payment</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -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()

View File

@@ -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