mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
If the user set no purchase order on an invoice, it makes no sense to warn them about details being different. The onchange for the purchase_id field is not only run when the user sets a purchase, but also when they open a new, empty form view. Normally this causes no problems, but in some contexts the user may want to define defaults for the payment term or bank account. If these are defined, they will not be False on a new draft invoice, but there will be no purchase, so the code interpreted the values as having "changed". We avoid this by simply not checking for changes if no purchase has been set on the invoice.