Skip to content

Commit

Permalink
[FIX] account_payment_purchase: Fix PO payment mode propagation when …
Browse files Browse the repository at this point in the history
…invoicing
  • Loading branch information
aritzolea committed Jan 31, 2025
1 parent 83b7ff5 commit bdfcf9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions account_payment_purchase/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class AccountMove(models.Model):
def _onchange_purchase_auto_complete(self):
new_mode = self.purchase_id.payment_mode_id.id or False
new_bank = self.purchase_id.supplier_partner_bank_id.id or False
res = {}
self = self.with_context(avoid_pay_mode_propagate=True)
res = super()._onchange_purchase_auto_complete() or {}
if self.payment_mode_id and new_mode and self.payment_mode_id.id != new_mode:
res["warning"] = {
"title": _("Warning"),
Expand All @@ -30,5 +31,4 @@ def _onchange_purchase_auto_complete(self):
return res
if new_bank:
self.partner_bank_id = new_bank
res = super()._onchange_purchase_auto_complete()
return res

0 comments on commit bdfcf9d

Please sign in to comment.