[FIX] Use correct company when search for mandate_id

Use the account.move company to search for the right partner mandate
This commit is contained in:
Hugo Santos
2024-02-06 17:31:09 +01:00
committed by David Ramia
parent 8154ba7c20
commit a452e1a4b7
4 changed files with 5 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ Account Banking Mandate
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:eb1e70284401ac6034fdc5377ebe1ea10cf1b66bded40581ebc4e4ddd228fcbf
!! source digest: sha256:a2e985ff665c753c4fc04968eca91622f81cf5c595fd9d26967c2aefea3556a3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png

View File

@@ -7,7 +7,7 @@
{
"name": "Account Banking Mandate",
"summary": "Banking mandates",
"version": "16.0.1.2.0",
"version": "16.0.1.2.1",
"development_status": "Production/Stable",
"license": "AGPL-3",
"author": "Compassion CH, "

View File

@@ -22,9 +22,10 @@ class AccountMove(models.Model):
related="payment_mode_id.payment_method_id.mandate_required", readonly=True
)
@api.depends("payment_mode_id", "partner_id")
@api.depends("company_id", "payment_mode_id", "partner_id")
def _compute_mandate_id(self):
for move in self:
move = move.with_company(move.company_id)
if move.payment_mode_id.payment_method_id.mandate_required:
move.mandate_id = move.partner_id.valid_mandate_id
else:

View File

@@ -366,7 +366,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:eb1e70284401ac6034fdc5377ebe1ea10cf1b66bded40581ebc4e4ddd228fcbf
!! source digest: sha256:a2e985ff665c753c4fc04968eca91622f81cf5c595fd9d26967c2aefea3556a3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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"><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"><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 adds a generic model for banking mandates.