Prevent overpay invoice without amount to pay
issue10573 review369291002
This commit is contained in:
1 parent
2c24cab714
commit
e6701a6a9a
2 files changed
+7
No files matched your search
@@ -3053,6 +3053,10 @@ class PayInvoice(Wizard):
|
||||
amount_to_pay=lang.currency(
|
||||
invoice.amount_to_pay, invoice.currency)))
|
||||
else:
|
||||
if not invoice.amount_to_pay:
|
||||
raise PayInvoiceError(
|
||||
gettext('account_invoice.msg_invoice_overpay_paid',
|
||||
invoice=invoice.rec_name))
|
||||
overpayment = amount_invoice - invoice.amount_to_pay
|
||||
|
||||
lines = []
|
||||
|
||||
@@ -63,6 +63,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<record model="ir.message" id="msg_invoice_pay_amount_greater_amount_to_pay">
|
||||
<field name="text">You cannot add a partial payment on invoice "%(invoice)s" with an amount greater than the amount to pay "%(amount_to_pay)s".</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_invoice_overpay_paid">
|
||||
<field name="text">You cannot overpay invoice "%(invoice)s" because there is no more left to pay.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_invoice_payment_line_unique">
|
||||
<field name="text">A payment line can be linked to only one invoice.</field>
|
||||
</record>
|
||||
|
||||
Reference in new issue
Block a user