Skip to content

Commit

Permalink
[MIG] account_banking_mandate_contact: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisho99 committed Mar 12, 2024
1 parent 2ed7034 commit 4298db0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 23 deletions.
16 changes: 10 additions & 6 deletions account_banking_mandate_contact/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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|
Expand Down Expand Up @@ -61,7 +61,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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_mandate_contact%0Aversion:%2015.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_mandate_contact%0Aversion:%2016.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.

Expand All @@ -82,6 +82,10 @@ Contributors
* Ernesto Tejeda
* Pedro M. Baeza

* `Sygel <https://www.sygel.es>`__:

* Alberto Martínez

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

Expand All @@ -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 <https://github.com/OCA/bank-payment/tree/15.0/account_banking_mandate_contact>`_ project on GitHub.
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/16.0/account_banking_mandate_contact>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_banking_mandate_contact/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions account_banking_mandate_contact/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 4 additions & 0 deletions account_banking_mandate_contact/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
* Carlos Dauden
* Ernesto Tejeda
* Pedro M. Baeza

* `Sygel <https://www.sygel.es>`__:

* Alberto Martínez
12 changes: 8 additions & 4 deletions account_banking_mandate_contact/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Account Banking Mandate Contact</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c037b632e64403ec6e4d61e7275eece4b909b3cdfe5199867e18ae8e362381bb
!! source digest: sha256:e64a6ce44499395afe175300e7c9551d1ea8bdd1263b8fc251600675ee2e07c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/bank-payment/tree/15.0/account_banking_mandate_contact"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-15-0/bank-payment-15-0-account_banking_mandate_contact"><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/bank-payment&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/bank-payment/tree/16.0/account_banking_mandate_contact"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_banking_mandate_contact"><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/bank-payment&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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.</p>
Expand Down Expand Up @@ -409,7 +409,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/bank-payment/issues/new?body=module:%20account_banking_mandate_contact%0Aversion:%2015.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_mandate_contact%0Aversion:%2016.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">
Expand All @@ -429,6 +429,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Pedro M. Baeza</li>
</ul>
</li>
<li><a class="reference external" href="https://www.sygel.es">Sygel</a>:<ul>
<li>Alberto Martínez</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -438,7 +442,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<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/15.0/account_banking_mandate_contact">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/16.0/account_banking_mandate_contact">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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ def _create_invoice(cls):
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(
Expand All @@ -127,7 +126,7 @@ def test_account_payment_order_core(self):
)
)
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()
Expand All @@ -145,12 +144,13 @@ def test_account_payment_order_core_extra(self):
)
)
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()
self.assertAlmostEqual(len(self.payment_order.payment_line_ids), 1)
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)

0 comments on commit 4298db0

Please sign in to comment.