Skip to content

Commit

Permalink
Merge fac1312 into 3a8f399
Browse files Browse the repository at this point in the history
  • Loading branch information
aisopuro committed Nov 12, 2019
2 parents 3a8f399 + fac1312 commit e241cad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions account_payment_purchase/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ class AccountInvoice(models.Model):

@api.onchange('purchase_id')
def purchase_order_change(self):
new_purchase = self.purchase_id
new_mode = self.purchase_id.payment_mode_id.id or False
new_bank = self.purchase_id.supplier_partner_bank_id.id or False
res = super(AccountInvoice, self).purchase_order_change()
if not new_purchase:
# User did not add a purchase order, no need to warn
return res
if self.payment_mode_id and self.payment_mode_id.id != new_mode:
res['warning'] = {
'title': _('Warning'),
Expand Down

0 comments on commit e241cad

Please sign in to comment.