mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_banking_sepa_direct_debit: Fixed settings view and test_sdd implementation
[UPD] Update account_banking_sepa_direct_debit.pot [UPD] README.rst
This commit is contained in:
@@ -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/13.0/account_banking_sepa_direct_debit
|
||||
:target: https://github.com/OCA/bank-payment/tree/14.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-13-0/bank-payment-13-0-account_banking_sepa_direct_debit
|
||||
:target: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-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/13.0
|
||||
:target: https://runbot.odoo-community.org/runbot/173/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
@@ -88,7 +88,7 @@ For defining a payment mode that uses SEPA direct debit:
|
||||
Usage
|
||||
=====
|
||||
|
||||
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.
|
||||
|
||||
@@ -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:%2013.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:%2014.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.
|
||||
|
||||
@@ -115,14 +115,17 @@ Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Pedro M. Baeza
|
||||
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
* Alexandre Fayolle
|
||||
* Raphaël Valyi
|
||||
* Sandy Carter
|
||||
* Antonio Espinosa <antonioea@antiun.com>
|
||||
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||
* Marçal Isern <marsal.isern@qubiq.es>
|
||||
* `Tecnativa <https://www.tecnativa.com>`__:
|
||||
|
||||
* Pedro M. Baeza
|
||||
* Sergio Teruel
|
||||
* Carlos Roca
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
@@ -137,6 +140,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/13.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/14.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.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0\n"
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
@@ -13,6 +13,13 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.actions.report,print_report_name:account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate
|
||||
msgid ""
|
||||
"'Mandate-%s-%s' % (object.unique_mandate_reference, "
|
||||
"object.partner_id.name.replace(' ', '_')"
|
||||
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 "<em>Account Number - IBAN:</em>"
|
||||
@@ -166,6 +173,13 @@ msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_line__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_method__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_mode__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_order__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_bank_payment_line__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_company__display_name
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_config_settings__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
@@ -206,17 +220,47 @@ msgstr ""
|
||||
msgid "First"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_line__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_method__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_mode__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_order__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_bank_payment_line__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_company__id
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_config_settings__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: 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 ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_line____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_method____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_mode____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_payment_order____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_bank_payment_line____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_company____last_update
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_res_config_settings____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__format
|
||||
msgid "Mandate Format"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
|
||||
#, python-format
|
||||
msgid "Mandate automatically set to expired after %d months without use."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:0
|
||||
#, python-format
|
||||
@@ -301,6 +345,11 @@ msgstr ""
|
||||
msgid "SEPA Direct Debit of customers"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.actions.report,name:account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate
|
||||
msgid "SEPA Mandate"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__scheme
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_search
|
||||
@@ -308,7 +357,6 @@ msgid "Scheme"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: 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 ""
|
||||
@@ -388,7 +436,6 @@ msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_search
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_tree
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Pedro M. Baeza
|
||||
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
* Alexandre Fayolle
|
||||
* Raphaël Valyi
|
||||
* Sandy Carter
|
||||
* Antonio Espinosa <antonioea@antiun.com>
|
||||
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||
* Marçal Isern <marsal.isern@qubiq.es>
|
||||
* `Tecnativa <https://www.tecnativa.com>`__:
|
||||
|
||||
* Pedro M. Baeza
|
||||
* Sergio Teruel
|
||||
* Carlos Roca
|
||||
|
||||
@@ -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/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><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/14.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-14-0/bank-payment-14-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/14.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
|
||||
@@ -435,7 +435,7 @@ method adjusting this field on each for having them.</li>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id3">Usage</a></h1>
|
||||
<p>In the menu <em>Invoicing/Accounting > Payments > Debit Order</em>, create a new debit
|
||||
<p>In the menu <em>Invoicing/Accounting > Customers > Debit Order</em>, create a new debit
|
||||
order and select the Payment Mode dedicated to SEPA Direct Debit that
|
||||
you created during the configuration step.</p>
|
||||
</div>
|
||||
@@ -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:%2013.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:%2014.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">
|
||||
@@ -460,14 +460,18 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Stéphane Bidoul <<a class="reference external" href="mailto:stephane.bidoul@acsone.eu">stephane.bidoul@acsone.eu</a>></li>
|
||||
<li>Alexandre Fayolle</li>
|
||||
<li>Raphaël Valyi</li>
|
||||
<li>Sandy Carter</li>
|
||||
<li>Antonio Espinosa <<a class="reference external" href="mailto:antonioea@antiun.com">antonioea@antiun.com</a>></li>
|
||||
<li>Sergio Teruel <<a class="reference external" href="mailto:sergio.teruel@tecnativa.com">sergio.teruel@tecnativa.com</a>></li>
|
||||
<li>Marçal Isern <<a class="reference external" href="mailto:marsal.isern@qubiq.es">marsal.isern@qubiq.es</a>></li>
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Sergio Teruel</li>
|
||||
<li>Carlos Roca</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
@@ -477,7 +481,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/13.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/14.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>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# from . import test_sdd # TODO port those tests
|
||||
from . import test_sdd
|
||||
from . import test_mandate
|
||||
|
||||
@@ -7,109 +7,215 @@ import base64
|
||||
from lxml import etree
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tests.common import SavepointCase
|
||||
from odoo.tools import float_compare
|
||||
|
||||
from odoo.addons.account.tests.account_test_multi_company_no_chart import (
|
||||
TestAccountMultiCompanyNoChartCommon,
|
||||
)
|
||||
|
||||
|
||||
class TestSDDBase(TestAccountMultiCompanyNoChartCommon):
|
||||
class TestSDDBase(SavepointCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
self = cls
|
||||
self.company = self.env["res.company"]
|
||||
self.account_model = self.env["account.account"]
|
||||
self.journal_model = self.env["account.journal"]
|
||||
self.payment_order_model = self.env["account.payment.order"]
|
||||
self.payment_line_model = self.env["account.payment.line"]
|
||||
self.mandate_model = self.env["account.banking.mandate"]
|
||||
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.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")
|
||||
cls.company_B = cls.env["res.company"].create({"name": "Company B"})
|
||||
user_type_payable = cls.env.ref("account.data_account_type_payable")
|
||||
cls.account_payable_company_B = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1110",
|
||||
"name": "Test Payable Account Company B",
|
||||
"user_type_id": user_type_payable.id,
|
||||
"reconcile": True,
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
user_type_receivable = cls.env.ref("account.data_account_type_receivable")
|
||||
cls.account_receivable_company_B = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1111",
|
||||
"name": "Test Receivable Account Company B",
|
||||
"user_type_id": user_type_receivable.id,
|
||||
"reconcile": True,
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
cls.company = cls.env["res.company"]
|
||||
cls.account_model = cls.env["account.account"]
|
||||
cls.journal_model = cls.env["account.journal"]
|
||||
cls.payment_order_model = cls.env["account.payment.order"]
|
||||
cls.payment_line_model = cls.env["account.payment.line"]
|
||||
cls.mandate_model = cls.env["account.banking.mandate"]
|
||||
cls.bank_line_model = cls.env["bank.payment.line"]
|
||||
cls.partner_bank_model = cls.env["res.partner.bank"]
|
||||
cls.attachment_model = cls.env["ir.attachment"]
|
||||
cls.invoice_model = cls.env["account.move"]
|
||||
cls.partner_agrolait = cls.env.ref("base.res_partner_2")
|
||||
cls.partner_c2c = cls.env.ref("base.res_partner_12")
|
||||
cls.eur_currency = cls.env.ref("base.EUR")
|
||||
cls.setUpAdditionalAccounts()
|
||||
cls.setUpAccountJournal()
|
||||
self.main_company = cls.company_B
|
||||
cls.main_company = cls.company_B
|
||||
cls.company_B.write(
|
||||
{
|
||||
"name": "Test EUR company",
|
||||
"currency_id": self.eur_currency.id,
|
||||
"currency_id": cls.eur_currency.id,
|
||||
"sepa_creditor_identifier": "FR78ZZZ424242",
|
||||
}
|
||||
)
|
||||
self.env.user.write(
|
||||
cls.env.user.write(
|
||||
{
|
||||
"company_ids": [(6, 0, self.main_company.ids)],
|
||||
"company_id": self.main_company.id,
|
||||
"company_ids": [(6, 0, cls.main_company.ids)],
|
||||
"company_id": cls.main_company.id,
|
||||
}
|
||||
)
|
||||
(self.partner_agrolait + self.partner_c2c).write(
|
||||
(cls.partner_agrolait + cls.partner_c2c).write(
|
||||
{
|
||||
"company_id": cls.main_company.id,
|
||||
"property_account_payable_id": cls.account_payable_company_B.id,
|
||||
"property_account_receivable_id": cls.account_receivable_company_B.id,
|
||||
}
|
||||
)
|
||||
self.company_bank = self.env.ref("account_payment_mode.main_company_iban").copy(
|
||||
cls.company_bank = cls.env.ref("account_payment_mode.main_company_iban").copy(
|
||||
{
|
||||
"company_id": self.main_company.id,
|
||||
"partner_id": self.main_company.partner_id.id,
|
||||
"company_id": cls.main_company.id,
|
||||
"partner_id": cls.main_company.partner_id.id,
|
||||
"bank_id": (
|
||||
self.env.ref("account_payment_mode.bank_la_banque_postale").id
|
||||
cls.env.ref("account_payment_mode.bank_la_banque_postale").id
|
||||
),
|
||||
}
|
||||
)
|
||||
# create journal
|
||||
self.bank_journal = self.journal_model.create(
|
||||
cls.bank_journal = cls.journal_model.create(
|
||||
{
|
||||
"name": "Company Bank journal",
|
||||
"type": "bank",
|
||||
"code": "BNKFC",
|
||||
"bank_account_id": self.company_bank.id,
|
||||
"bank_id": self.company_bank.bank_id.id,
|
||||
"bank_account_id": cls.company_bank.id,
|
||||
"bank_id": cls.company_bank.bank_id.id,
|
||||
}
|
||||
)
|
||||
# update payment mode
|
||||
self.payment_mode = self.env.ref(
|
||||
cls.payment_mode = cls.env.ref(
|
||||
"account_banking_sepa_direct_debit.payment_mode_inbound_sepa_dd1"
|
||||
).copy({"company_id": self.main_company.id})
|
||||
self.payment_mode.write(
|
||||
{"bank_account_link": "fixed", "fixed_journal_id": self.bank_journal.id}
|
||||
).copy({"company_id": cls.main_company.id})
|
||||
cls.payment_mode.write(
|
||||
{"bank_account_link": "fixed", "fixed_journal_id": cls.bank_journal.id}
|
||||
)
|
||||
# Copy partner bank accounts
|
||||
bank1 = self.env.ref("account_payment_mode.res_partner_12_iban").copy(
|
||||
{"company_id": self.main_company.id}
|
||||
bank1 = cls.env.ref("account_payment_mode.res_partner_12_iban").copy(
|
||||
{"company_id": cls.main_company.id}
|
||||
)
|
||||
self.mandate12 = self.env.ref(
|
||||
cls.mandate12 = cls.env.ref(
|
||||
"account_banking_sepa_direct_debit.res_partner_12_mandate"
|
||||
).copy(
|
||||
{
|
||||
"partner_bank_id": bank1.id,
|
||||
"company_id": self.main_company.id,
|
||||
"company_id": cls.main_company.id,
|
||||
"state": "valid",
|
||||
"unique_mandate_reference": "BMTEST12",
|
||||
}
|
||||
)
|
||||
bank2 = self.env.ref("account_payment_mode.res_partner_2_iban").copy(
|
||||
{"company_id": self.main_company.id}
|
||||
bank2 = cls.env.ref("account_payment_mode.res_partner_2_iban").copy(
|
||||
{"company_id": cls.main_company.id}
|
||||
)
|
||||
self.mandate2 = self.env.ref(
|
||||
cls.mandate2 = cls.env.ref(
|
||||
"account_banking_sepa_direct_debit.res_partner_2_mandate"
|
||||
).copy(
|
||||
{
|
||||
"partner_bank_id": bank2.id,
|
||||
"company_id": self.main_company.id,
|
||||
"company_id": cls.main_company.id,
|
||||
"state": "valid",
|
||||
"unique_mandate_reference": "BMTEST2",
|
||||
}
|
||||
)
|
||||
# Trigger the recompute of account type on res.partner.bank
|
||||
self.partner_bank_model.search([])._compute_acc_type()
|
||||
cls.partner_bank_model.search([])._compute_acc_type()
|
||||
|
||||
@classmethod
|
||||
def setUpAdditionalAccounts(cls):
|
||||
""" Set up some addionnal accounts: expenses, revenue, ... """
|
||||
user_type_income = cls.env.ref("account.data_account_type_direct_costs")
|
||||
cls.account_income = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1112",
|
||||
"name": "Sale - Test Account",
|
||||
"user_type_id": user_type_income.id,
|
||||
}
|
||||
)
|
||||
user_type_expense = cls.env.ref("account.data_account_type_expenses")
|
||||
cls.account_expense = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1113",
|
||||
"name": "HR Expense - Test Purchase Account",
|
||||
"user_type_id": user_type_expense.id,
|
||||
}
|
||||
)
|
||||
user_type_revenue = cls.env.ref("account.data_account_type_revenue")
|
||||
cls.account_revenue = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1114",
|
||||
"name": "Sales - Test Sales Account",
|
||||
"user_type_id": user_type_revenue.id,
|
||||
"reconcile": True,
|
||||
}
|
||||
)
|
||||
user_type_income = cls.env.ref("account.data_account_type_direct_costs")
|
||||
cls.account_income_company_B = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1112",
|
||||
"name": "Sale - Test Account Company B",
|
||||
"user_type_id": user_type_income.id,
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
user_type_expense = cls.env.ref("account.data_account_type_expenses")
|
||||
cls.account_expense_company_B = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1113",
|
||||
"name": "HR Expense - Test Purchase Account Company B",
|
||||
"user_type_id": user_type_expense.id,
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
user_type_revenue = cls.env.ref("account.data_account_type_revenue")
|
||||
cls.account_revenue_company_B = cls.env["account.account"].create(
|
||||
{
|
||||
"code": "NC1114",
|
||||
"name": "Sales - Test Sales Account Company B",
|
||||
"user_type_id": user_type_revenue.id,
|
||||
"reconcile": True,
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def setUpAccountJournal(cls):
|
||||
# Set up some journals
|
||||
cls.journal_purchase_company_B = cls.env["account.journal"].create(
|
||||
{
|
||||
"name": "Purchase Journal Company B - Test",
|
||||
"code": "AJ-PURC",
|
||||
"type": "purchase",
|
||||
"company_id": cls.company_B.id,
|
||||
"payment_debit_account_id": cls.account_expense_company_B.id,
|
||||
"payment_credit_account_id": cls.account_expense_company_B.id,
|
||||
}
|
||||
)
|
||||
cls.journal_sale_company_B = cls.env["account.journal"].create(
|
||||
{
|
||||
"name": "Sale Journal Company B - Test",
|
||||
"code": "AJ-SALE",
|
||||
"type": "sale",
|
||||
"company_id": cls.company_B.id,
|
||||
"payment_debit_account_id": cls.account_income_company_B.id,
|
||||
"payment_credit_account_id": cls.account_income_company_B.id,
|
||||
}
|
||||
)
|
||||
cls.journal_general_company_B = cls.env["account.journal"].create(
|
||||
{
|
||||
"name": "General Journal Company B - Test",
|
||||
"code": "AJ-GENERAL",
|
||||
"type": "general",
|
||||
"company_id": cls.company_B.id,
|
||||
}
|
||||
)
|
||||
|
||||
def check_sdd(self):
|
||||
self.mandate2.recurrent_sequence_type = "first"
|
||||
@@ -194,7 +300,7 @@ class TestSDDBase(TestAccountMultiCompanyNoChartCommon):
|
||||
payment_order.generated2uploaded()
|
||||
self.assertEqual(payment_order.state, "uploaded")
|
||||
for inv in [invoice1, invoice2]:
|
||||
self.assertEqual(inv.invoice_payment_state, "paid")
|
||||
self.assertEqual(inv.payment_state, "paid")
|
||||
self.assertEqual(self.mandate2.recurrent_sequence_type, "recurring")
|
||||
return
|
||||
|
||||
|
||||
@@ -9,26 +9,16 @@
|
||||
ref="account_banking_pain_base.view_account_config_settings"
|
||||
/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//div[@id='pain']/div[@id='pain_group_pain_multiple_identifier']"
|
||||
position="after"
|
||||
>
|
||||
<div
|
||||
id="pain_sepa_creditor_identifier"
|
||||
class="col-12 col-lg-6 o_setting_box"
|
||||
>
|
||||
<div class="o_setting_left_pane" />
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">
|
||||
<label for="sepa_creditor_identifier" />
|
||||
</span>
|
||||
<div class="text-muted">
|
||||
ICS of your company
|
||||
</div>
|
||||
<div class="text-muted">
|
||||
<field name="sepa_creditor_identifier" />
|
||||
</div>
|
||||
</div>
|
||||
<xpath expr="//div[@id='pain']/div/div/div" position="inside">
|
||||
<div class="row mt16">
|
||||
<label
|
||||
for="sepa_creditor_identifier"
|
||||
class="col-md-3 o_light_label"
|
||||
/>
|
||||
<field
|
||||
name="sepa_creditor_identifier"
|
||||
placeholder="Write the ICS of your company"
|
||||
/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user