From 4298db02a22a64ec87cdd66de775f2ecc95d83eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alberto=20Mart=C3=ADnez?=
Date: Wed, 6 Mar 2024 13:51:11 +0100
Subject: [PATCH] [MIG] account_banking_mandate_contact: Migration to 16.0
---
account_banking_mandate_contact/README.rst | 16 ++++++++++------
account_banking_mandate_contact/__manifest__.py | 2 +-
.../i18n/account_banking_mandate_contact.pot | 2 +-
.../models/res_partner.py | 12 ++++++------
.../readme/CONTRIBUTORS.rst | 4 ++++
.../static/description/index.html | 12 ++++++++----
.../tests/test_account_payment_order.py | 10 +++++-----
7 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/account_banking_mandate_contact/README.rst b/account_banking_mandate_contact/README.rst
index c1f73c485..cb6e51efd 100644
--- a/account_banking_mandate_contact/README.rst
+++ b/account_banking_mandate_contact/README.rst
@@ -7,7 +7,7 @@ Account Banking Mandate Contact
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:c037b632e64403ec6e4d61e7275eece4b909b3cdfe5199867e18ae8e362381bb
+ !! source digest: sha256:e64a6ce44499395afe175300e7c9551d1ea8bdd1263b8fc251600675ee2e07c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -17,13 +17,13 @@ Account Banking Mandate Contact
: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/15.0/account_banking_mandate_contact
+ :target: https://github.com/OCA/bank-payment/tree/16.0/account_banking_mandate_contact
: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-15-0/bank-payment-15-0-account_banking_mandate_contact
+ :target: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_banking_mandate_contact
: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/bank-payment&target_branch=15.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -61,7 +61,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -82,6 +82,10 @@ Contributors
* Ernesto Tejeda
* Pedro M. Baeza
+* `Sygel `__:
+
+ * Alberto Martínez
+
Maintainers
~~~~~~~~~~~
@@ -95,6 +99,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 `_ project on GitHub.
+This module is part of the `OCA/bank-payment `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_banking_mandate_contact/__manifest__.py b/account_banking_mandate_contact/__manifest__.py
index 16cca8aea..e32d1020e 100644
--- a/account_banking_mandate_contact/__manifest__.py
+++ b/account_banking_mandate_contact/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Account Banking Mandate Contact",
"summary": "Assign specific banking mandates in contact level",
- "version": "15.0.1.0.1",
+ "version": "16.0.1.0.1",
"development_status": "Production/Stable",
"category": "Banking addons",
"website": "https://github.com/OCA/bank-payment",
diff --git a/account_banking_mandate_contact/i18n/account_banking_mandate_contact.pot b/account_banking_mandate_contact/i18n/account_banking_mandate_contact.pot
index f129f31cf..856a796d5 100644
--- a/account_banking_mandate_contact/i18n/account_banking_mandate_contact.pot
+++ b/account_banking_mandate_contact/i18n/account_banking_mandate_contact.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
diff --git a/account_banking_mandate_contact/models/res_partner.py b/account_banking_mandate_contact/models/res_partner.py
index 4a397d3a3..cc6cfd96c 100644
--- a/account_banking_mandate_contact/models/res_partner.py
+++ b/account_banking_mandate_contact/models/res_partner.py
@@ -13,9 +13,9 @@ class ResPartner(models.Model):
)
def _compute_valid_mandate_id(self):
- procesed_partners = self.browse()
- for partner in self:
- if partner.contact_mandate_id.state == "valid":
- partner.valid_mandate_id = partner.contact_mandate_id
- procesed_partners |= partner
- return super(ResPartner, self - procesed_partners)._compute_valid_mandate_id()
+ partners_to_process = self.filtered(
+ lambda x: x.contact_mandate_id.state == "valid"
+ )
+ for partner in partners_to_process:
+ partner.valid_mandate_id = partner.contact_mandate_id
+ return super(ResPartner, self - partners_to_process)._compute_valid_mandate_id()
diff --git a/account_banking_mandate_contact/readme/CONTRIBUTORS.rst b/account_banking_mandate_contact/readme/CONTRIBUTORS.rst
index 35b76b8b0..18e8db519 100644
--- a/account_banking_mandate_contact/readme/CONTRIBUTORS.rst
+++ b/account_banking_mandate_contact/readme/CONTRIBUTORS.rst
@@ -3,3 +3,7 @@
* Carlos Dauden
* Ernesto Tejeda
* Pedro M. Baeza
+
+* `Sygel `__:
+
+ * Alberto Martínez
\ No newline at end of file
diff --git a/account_banking_mandate_contact/static/description/index.html b/account_banking_mandate_contact/static/description/index.html
index 633c4576d..aa1224d5e 100644
--- a/account_banking_mandate_contact/static/description/index.html
+++ b/account_banking_mandate_contact/static/description/index.html
@@ -367,9 +367,9 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:c037b632e64403ec6e4d61e7275eece4b909b3cdfe5199867e18ae8e362381bb
+!! source digest: sha256:e64a6ce44499395afe175300e7c9551d1ea8bdd1263b8fc251600675ee2e07c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows to select a specific banking mandate
(and thus, a specific bank account) at contact level, so that when doing
a debit order, such mandate is used for the invoices issued to that contact.
@@ -409,7 +409,7 @@ a debit order, such mandate is used for the invoices issued to that contact.
Bugs are tracked on GitHub 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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -429,6 +429,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
Pedro M. Baeza
+
Sygel:
+
@@ -438,7 +442,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
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 project on GitHub.
+
This module is part of the OCA/bank-payment project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_banking_mandate_contact/tests/test_account_payment_order.py b/account_banking_mandate_contact/tests/test_account_payment_order.py
index c40dd11d3..34cc4259d 100644
--- a/account_banking_mandate_contact/tests/test_account_payment_order.py
+++ b/account_banking_mandate_contact/tests/test_account_payment_order.py
@@ -111,14 +111,13 @@ class TestAccountPaymentOrder(TransactionCase):
line_form.tax_ids.clear()
invoice = invoice_form.save()
invoice.action_post()
+
return invoice
def test_invoice_payment_mode(self):
self.assertEqual(self.invoice.state, "posted")
self.assertEqual(self.invoice.payment_mode_id, self.payment_core)
- self.assertEqual(
- self.invoice.invoice_date_due, fields.Date.from_string("2021-01-01")
- )
+ self.assertEqual(self.invoice.invoice_date_due, fields.Date.today())
def test_account_payment_order_core(self):
line_create_form = Form(
@@ -127,7 +126,7 @@ class TestAccountPaymentOrder(TransactionCase):
)
)
line_create_form.date_type = "due"
- line_create_form.due_date = fields.Date.from_string("2021-01-01")
+ line_create_form.due_date = fields.Date.today()
line_create = line_create_form.save()
line_create.populate()
line_create.create_payment_lines()
@@ -145,7 +144,7 @@ class TestAccountPaymentOrder(TransactionCase):
)
)
line_create_form.date_type = "due"
- line_create_form.due_date = fields.Date.from_string("2021-01-01")
+ line_create_form.due_date = fields.Date.today()
line_create = line_create_form.save()
line_create.populate()
line_create.create_payment_lines()
@@ -153,4 +152,5 @@ class TestAccountPaymentOrder(TransactionCase):
payment_line = self.payment_order.payment_line_ids.filtered(
lambda x: x.partner_id == self.partner
)
+ self.assertEqual(payment_line.mandate_id, self.mandate_b2b)
self.assertEqual(payment_line.partner_bank_id, self.partner_bank_b2b)