Do not allow overpayment of invoice when write-off amount is negative

When paying less than the amount to pay, there is no overpayment.
This commit is contained in:
Cédric Krier committed 2023-07-14 12:01:05 +02:00
1 parent c3da634f9f
commit 03e0455e75
1 file changed
+6 -1
+6 -1
View File
@@ -3157,7 +3157,12 @@ class PayInvoiceAsk(ModelView):
('writeoff', "Write-Off"),
('partial', "Partial Payment"),
('overpayment', "Overpayment"),
], 'Type', required=True)
], 'Type', required=True,
domain=[
If(Eval('amount_writeoff', 0) >= 0,
('type', 'in', ['writeoff', 'partial']),
()),
])
writeoff = fields.Many2One(
'account.move.reconcile.write_off', "Write Off",
domain=[