Skip to content

Commit

Permalink
[FIX] account_payment_purchase: solved error get payment mode and ban…
Browse files Browse the repository at this point in the history
…k id close OCA#899
  • Loading branch information
cramosh committed Feb 25, 2022
1 parent 6b04325 commit d54237b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions account_payment_purchase/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AccountMove(models.Model):

@api.onchange("purchase_vendor_bill_id", "purchase_id")
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
new_mode = self.purchase_vendor_bill_id.purchase_order_id.payment_mode_id.id or False
new_bank = self.purchase_vendor_bill_id.purchase_order_id.payment_mode_id.id or False
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"] = {
Expand Down

0 comments on commit d54237b

Please sign in to comment.