mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_payment_partner: Cache missed error when compute before than create
TT30991 TT30995 TT30999 TT31006
This commit is contained in:
@@ -157,5 +157,7 @@ class AccountMove(models.Model):
|
||||
""" Force compute invoice_partner_bank_id when invoice is created from SO
|
||||
to avoid that odoo _prepare_invoice method value will be set"""
|
||||
if self.env.context.get("active_model") == "sale.order": # pragma: no cover
|
||||
vals.pop("invoice_partner_bank_id", False)
|
||||
virtual_move = self.new(vals)
|
||||
virtual_move._compute_invoice_partner_bank()
|
||||
vals["invoice_partner_bank_id"] = virtual_move.invoice_partner_bank_id
|
||||
return super().create(vals)
|
||||
|
||||
Reference in New Issue
Block a user