Skip to content

Commit

Permalink
[MIG] l10n_ch_pain_direct_debit: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon authored and ecino committed Feb 27, 2024
1 parent 8f04787 commit 31452c8
Show file tree
Hide file tree
Showing 29 changed files with 668 additions and 464 deletions.
2 changes: 1 addition & 1 deletion l10n_ch_base_bank/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Switzerland - Bank type
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:51552dc058fb6842651372cdb6fd137a9cc413812f14c56d324f9d97e9c56273
!! source digest: sha256:2be21f8c5e3977467382e613ebbdc9d3925e53aeec1a5a290cfaf03f13731400
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
1 change: 1 addition & 0 deletions l10n_ch_base_bank/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "AGPL-3",
"depends": ["base_iban", "l10n_ch"],
"data": ["views/bank.xml"],
"demo": ["demo/res_bank.xml"],
"auto_install": True,
"installable": True,
}
7 changes: 7 additions & 0 deletions l10n_ch_base_bank/demo/res_bank.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<odoo>
<record model="res.bank" id="bank_postfinance">
<field name="name">PostFinance</field>
<field name="bic">POFICHBEXXX</field>
<field name="clearing">9000</field>
</record>
</odoo>
3 changes: 2 additions & 1 deletion l10n_ch_base_bank/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ def _check_bank_type_for_type_isr(self):
):
raise exceptions.ValidationError(
_(
"Bank account must contain a subscription number for"
"Bank account %s must contain a subscription number for"
" ISR ref type."
)
% bank_acc.acc_number
)
return True

Expand Down
2 changes: 1 addition & 1 deletion l10n_ch_base_bank/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Switzerland - Bank type</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:51552dc058fb6842651372cdb6fd137a9cc413812f14c56d324f9d97e9c56273
!! source digest: sha256:2be21f8c5e3977467382e613ebbdc9d3925e53aeec1a5a290cfaf03f13731400
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/l10n-switzerland/tree/14.0/l10n_ch_base_bank"><img alt="OCA/l10n-switzerland" src="https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-switzerland-14-0/l10n-switzerland-14-0-l10n_ch_base_bank"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon extend the features of l10n_ch.</p>
Expand Down
5 changes: 5 additions & 0 deletions l10n_ch_base_bank/tests/test_create_invoice.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright 2012-2019 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import exceptions
from odoo.tests import tagged
from odoo.tests.common import Form, SavepointCase


@tagged("post_install", "-at_install")
class TestCreateMove(SavepointCase):
@classmethod
def setUpClass(cls):
Expand All @@ -20,6 +22,7 @@ def setUpClass(cls):
"bank_id": bank.id,
"acc_number": "ISR",
"l10n_ch_isr_subscription_chf": "01-162-8",
"l10n_ch_isr_subscription_eur": "03-162-5",
"sequence": 1,
}
)
Expand All @@ -44,6 +47,7 @@ def new_form(self, with_bank_account=True):
# )
inv.partner_id = self.partner
inv.journal_id = self.journal
inv.partner_bank_id = self.bank_account
return inv

def test_emit_move_with_isr_ref(self):
Expand Down Expand Up @@ -100,6 +104,7 @@ def test_emit_move_with_isr_ref_subscr_num_wrong_currency(self):
inv_form = self.new_form()
move = inv_form.save()
self.assertFalse(move._has_isr_ref())
self.bank_account.l10n_ch_isr_subscription_eur = False
move.currency_id = self.env.ref("base.EUR")
with self.assertRaises(exceptions.ValidationError):
inv_form.ref = "132000000000000000000000014"
Expand Down
95 changes: 67 additions & 28 deletions l10n_ch_pain_direct_debit/README.rst
Original file line number Diff line number Diff line change
@@ -1,66 +1,105 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

====================================
Switzerland - ISO 20022 direct debit
====================================
===============================
Switzerland - PAIN Direct Debit
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:962c7b0b1ca135e856268c51d78c34e2030a40263f0f00b4e14f5c66aef88d5a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--switzerland-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-switzerland/tree/14.0/l10n_ch_pain_direct_debit
:alt: OCA/l10n-switzerland
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-switzerland-14-0/l10n-switzerland-14-0-l10n_ch_pain_direct_debit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-switzerland&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds support for *pain.008.001.02.ch.03* which is used for ISO 20022 direct debits in Switzerland.

It implements the guidelines for `ISO 20022 direct debits <http://www.six-interbank-clearing.com/dam/downloads/en/standardization/iso/swiss-recommendations/implementation-guidelines-swiss-dd.pdf>`_ published by SIX Interbank Clearing.

**Table of contents**

.. contents::
:local:

Configuration
=============

In the menu *Accounting > Configuration > Management > Payment Methods*,
select the payment method that has the code *sepa_direct_debit* and
set the *PAIN Version* to *pain.008.001.02.ch.03 (direct debit in Switzerland)*.


Usage
=====

This module doesn't modify the standard usage of the modules
*account_payment_order* and *account_banking_sepa_direct_debit*.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/125/9.0

Known issues / Roadmap
======================

* There is still some work to be done to make a good ISO20022 direct debit file for switzerland that comply with the guidelines of SIX Interbank Clearing. That's why this module is not installable for the moment.


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/l10n-switzerland/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.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-switzerland/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-switzerland/issues/new?body=module:%20l10n_ch_pain_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.

Credits
=======

Authors
~~~~~~~

* Akretion
* Camptocamp
* Compassion

Contributors
------------
~~~~~~~~~~~~

* Alexis de Lattre <[email protected]>
* Emanuel Cino <[email protected]>

Maintainers
~~~~~~~~~~~

Maintainer
----------
This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via
.. |maintainer-ecino| image:: https://github.com/ecino.png?size=40px
:target: https://github.com/ecino
:alt: ecino

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via| |maintainer-ecino|

This module is part of the `OCA/l10n-switzerland <https://github.com/OCA/l10n-switzerland/tree/14.0/l10n_ch_pain_direct_debit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion l10n_ch_pain_direct_debit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import pre_init_hook
18 changes: 4 additions & 14 deletions l10n_ch_pain_direct_debit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,17 @@
{
"name": "Switzerland - PAIN Direct Debit",
"summary": "Generate ISO 20022 direct debits",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Finance",
"author": "Akretion,Camptocamp,Compassion,Odoo Community Association(OCA)",
"website": "https://github.com/OCA/l10n-switzerland",
"license": "AGPL-3",
"maintainers": ["alexis-via", "ecino"],
"depends": ["account_banking_sepa_direct_debit", "l10n_ch_pain_base"],
"external_dependencies": {
"python": [
"openupgradelib"
]
},
"external_dependencies": {"python": ["openupgradelib"]},
"data": [
"data/payment_type.xml",
"data/export_filename_sequence.xml",
"views/account_payment_line_view.xml",
"views/account_payment_mode_view.xml",
"views/account_payment_order_view.xml",
"views/bank_payment_line_view.xml",
"data/account_payment_method.xml",
],
"demo": ["demo/dd_demo.xml"],
"pre_init_hook": "pre_init_hook",
"auto_install": False,
"installable": True,
}
17 changes: 0 additions & 17 deletions l10n_ch_pain_direct_debit/data/export_filename_sequence.xml

This file was deleted.

53 changes: 0 additions & 53 deletions l10n_ch_pain_direct_debit/demo/dd_demo.xml

This file was deleted.

31 changes: 0 additions & 31 deletions l10n_ch_pain_direct_debit/hooks.py

This file was deleted.

20 changes: 0 additions & 20 deletions l10n_ch_pain_direct_debit/migrations/11.0.1.0.1/pre-migration.py

This file was deleted.

3 changes: 2 additions & 1 deletion l10n_ch_pain_direct_debit/models/account_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ class AccountPaymentLine(models.Model):
_inherit = "account.payment.line"

local_instrument = fields.Selection(
selection_add=[("LSV+", "LSV+"), ("DDCOR1", "DDCOR1")]
selection_add=[("LSV+", "LSV+"), ("DDCOR1", "DDCOR1")],
ondelete={"LSV+": "set null", "DDCOR1": "set null"},
)
Loading

0 comments on commit 31452c8

Please sign in to comment.