[MIG]account_banking_sepa_direct_debit: Migration to 15.0

[UPD] Update account_banking_sepa_direct_debit.pot

[UPD] README.rst
This commit is contained in:
manu
2022-04-08 13:34:25 +02:00
committed by Reyes4711
parent b07442054d
commit d6c7651fd8
12 changed files with 98 additions and 117 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/14.0/account_banking_sepa_direct_debit
:target: https://github.com/OCA/bank-payment/tree/15.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-14-0/bank-payment-14-0-account_banking_sepa_direct_debit
:target: https://translation.odoo-community.org/projects/bank-payment-15-0/bank-payment-15-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/14.0
:target: https://runbot.odoo-community.org/runbot/173/15.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:%2014.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:%2015.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.
@@ -126,6 +126,7 @@ Contributors
* Pedro M. Baeza
* Sergio Teruel
* Carlos Roca
* Manuel Regidor <manuel.regidor@sygel.es>
Maintainers
~~~~~~~~~~~
@@ -140,6 +141,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/14.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/15.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

@@ -5,12 +5,22 @@
{
"name": "Account Banking SEPA Direct Debit",
"summary": "Create SEPA files for Direct Debit",
"version": "14.0.1.3.1",
"version": "15.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",
],
},
"assets": {
"web.assets_backend": [
"/account_banking_sepa_direct_debit/static/src/css/report.css"
],
},
"data": [
"views/account_banking_mandate_view.xml",
"views/res_config_settings.xml",

View File

@@ -1,51 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<record id="payment_mode_inbound_sepa_dd1" model="account.payment.mode">
<field name="name">SEPA Direct Debit of customers</field>
<field name="company_id" ref="base.main_company" />
<field name="bank_account_link">variable</field>
<field name="payment_method_id" ref="sepa_direct_debit" />
<field name="default_journal_ids" search="[('type', '=', 'sale')]" />
</record>
<record id="base.main_company" model="res.company">
<field name="sepa_creditor_identifier">FR78ZZZ424242</field>
</record>
<!-- Azure Interior -->
<record id="res_partner_12_mandate" model="account.banking.mandate">
<field
name="partner_bank_id"
ref="account_payment_mode.res_partner_12_iban"
/>
<field name="format">sepa</field>
<field name="type">recurrent</field>
<field name="recurrent_sequence_type">first</field>
<field name="signature_date" eval="time.strftime('%Y-01-01')" />
<field name="state">valid</field>
</record>
<record id="base.res_partner_12" model="res.partner">
<field
name="customer_payment_mode_id"
ref="payment_mode_inbound_sepa_dd1"
/>
</record>
<!-- Deco Addict -->
<record id="res_partner_2_mandate" model="account.banking.mandate">
<field
name="partner_bank_id"
ref="account_payment_mode.res_partner_2_iban"
/>
<field name="format">sepa</field>
<field name="type">recurrent</field>
<field name="recurrent_sequence_type">first</field>
<field name="signature_date" eval="time.strftime('%Y-%m-01')" />
<field name="state">valid</field>
</record>
<record id="base.res_partner_2" model="res.partner">
<field
name="customer_payment_mode_id"
ref="payment_mode_inbound_sepa_dd1"
/>
</record>
</data>
<odoo noupdate="1">
<record id="payment_mode_inbound_sepa_dd1" model="account.payment.mode">
<field name="name">SEPA Direct Debit of customers</field>
<field name="company_id" ref="base.main_company" />
<field name="bank_account_link">variable</field>
<field name="payment_method_id" ref="sepa_direct_debit" />
<field name="default_journal_ids" search="[('type', '=', 'sale')]" />
</record>
<record id="base.main_company" model="res.company">
<field name="sepa_creditor_identifier">FR78ZZZ424242</field>
</record>
<!-- Azure Interior -->
<record id="res_partner_12_mandate" model="account.banking.mandate">
<field name="partner_bank_id" ref="account_payment_mode.res_partner_12_iban" />
<field name="format">sepa</field>
<field name="type">recurrent</field>
<field name="recurrent_sequence_type">first</field>
<field name="signature_date" eval="time.strftime('%Y-01-01')" />
<field name="state">valid</field>
</record>
<record id="base.res_partner_12" model="res.partner">
<field name="customer_payment_mode_id" ref="payment_mode_inbound_sepa_dd1" />
</record>
<!-- Deco Addict -->
<record id="res_partner_2_mandate" model="account.banking.mandate">
<field name="partner_bank_id" ref="account_payment_mode.res_partner_2_iban" />
<field name="format">sepa</field>
<field name="type">recurrent</field>
<field name="recurrent_sequence_type">first</field>
<field name="signature_date" eval="time.strftime('%Y-%m-01')" />
<field name="state">valid</field>
</record>
<record id="base.res_partner_2" model="res.partner">
<field name="customer_payment_mode_id" ref="payment_mode_inbound_sepa_dd1" />
</record>
</odoo>

View File

@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -142,7 +142,7 @@ msgstr ""
#, 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"
"order <a href=# data-oe-model=account.payment.order data-oe-id=%d>{}</a> has"
" been marked as uploaded."
msgstr ""
@@ -173,13 +173,6 @@ 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 ""
@@ -220,36 +213,12 @@ 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"

View File

@@ -6,7 +6,8 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import _, api, exceptions, fields, models
from odoo import _, api, fields, models
from odoo.exceptions import UserError
NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36
@@ -39,7 +40,6 @@ class AccountBankingMandate(models.Model):
)
scheme = fields.Selection(
[("CORE", "Basic (CORE)"), ("B2B", "Enterprise (B2B)")],
string="Scheme",
default="CORE",
tracking=80,
)
@@ -50,7 +50,7 @@ class AccountBankingMandate(models.Model):
def _check_recurring_type(self):
for mandate in self:
if mandate.type == "recurrent" and not mandate.recurrent_sequence_type:
raise exceptions.Warning(
raise UserError(
_("The recurrent mandate '%s' must have a sequence type.")
% mandate.unique_mandate_reference
)

View File

@@ -1,7 +1,7 @@
# Copyright 2020 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
from odoo import api, fields, models
class AccountPaymentMethod(models.Model):
@@ -33,3 +33,9 @@ class AccountPaymentMethod(models.Model):
path = "account_banking_sepa_direct_debit/data/%s.xsd" % self.pain_version
return path
return super().get_xsd_file_path()
@api.model
def _get_payment_method_information(self):
res = super()._get_payment_method_information()
res["sepa_direct_debit"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
return res

View File

@@ -302,8 +302,7 @@ class AccountPaymentOrder(models.Model):
"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."
)
% (order.id, order.name)
"data-oe-id=%d>{}</a> has been marked as uploaded."
).format(order.id, order.name)
)
return res

View File

@@ -11,5 +11,15 @@ def update_bank_journals(cr, registry):
journals = ajo.search([("type", "=", "bank")])
sdd = env.ref("account_banking_sepa_direct_debit.sepa_direct_debit")
if sdd:
journals.write({"inbound_payment_method_ids": [(4, sdd.id)]})
journals.write(
{
"inbound_payment_method_line_ids": [
(
0,
0,
{"payment_method_id": sdd.id, "name": "SEPA Direct Debit"},
)
]
}
)
return

View File

@@ -10,3 +10,4 @@
* Pedro M. Baeza
* Sergio Teruel
* Carlos Roca
* Manuel Regidor <manuel.regidor@sygel.es>

View File

@@ -1,17 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="assets_common"
name="account_banking_sepa_direct_debit pdf assets"
inherit_id="web.report_assets_common"
>
<xpath expr="." position="inside">
<link
href="/account_banking_sepa_direct_debit/static/src/css/report.css"
rel="stylesheet"
/>
</xpath>
</template>
<!-- QWeb Report -->
<record id="report_sepa_direct_debit_mandate" model="ir.actions.report">
<field name="name">SEPA Mandate</field>

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/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><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/15.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-15-0/bank-payment-15-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/15.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:%2014.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:%2015.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">
@@ -472,6 +472,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Carlos Roca</li>
</ul>
</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -481,7 +482,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/14.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/15.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

@@ -7,11 +7,11 @@ import base64
from lxml import etree
from odoo import fields
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.tools import float_compare
class TestSDDBase(SavepointCase):
class TestSDDBase(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -89,6 +89,18 @@ class TestSDDBase(SavepointCase):
"code": "BNKFC",
"bank_account_id": cls.company_bank.id,
"bank_id": cls.company_bank.bank_id.id,
"inbound_payment_method_line_ids": [
(
0,
0,
{
"payment_method_id": cls.env.ref(
"account_banking_sepa_direct_debit.sepa_direct_debit"
).id,
"payment_account_id": cls.account_expense_company_B.id,
},
)
],
}
)
# update payment mode
@@ -194,8 +206,7 @@ class TestSDDBase(SavepointCase):
"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,
"default_account_id": cls.account_expense_company_B.id,
}
)
cls.journal_sale_company_B = cls.env["account.journal"].create(
@@ -204,8 +215,7 @@ class TestSDDBase(SavepointCase):
"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,
"default_account_id": cls.account_income_company_B.id,
}
)
cls.journal_general_company_B = cls.env["account.journal"].create(