diff --git a/invoice.py b/invoice.py
index f000a13a7c..da07842aca 100644
--- a/invoice.py
+++ b/invoice.py
@@ -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 = []
diff --git a/message.xml b/message.xml
index 64b1e925bc..f716d48040 100644
--- a/message.xml
+++ b/message.xml
@@ -63,6 +63,9 @@ this repository contains the full copyright notices and license terms. -->
You cannot add a partial payment on invoice "%(invoice)s" with an amount greater than the amount to pay "%(amount_to_pay)s".
+
+ You cannot overpay invoice "%(invoice)s" because there is no more left to pay.
+
A payment line can be linked to only one invoice.