changeset 4777e271bb0c in modules/account_invoice:5.2
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=4777e271bb0c
description:
        Consider also invoices with zero lines as credit notes

        issue8943
        review284621002
        (grafted from ae31d47e133cfbe3e49de3b85631dc54771509bd)
diffstat:

 invoice.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5a3b304b7003 -r 4777e271bb0c invoice.py
--- a/invoice.py        Mon Dec 02 20:56:39 2019 +0100
+++ b/invoice.py        Tue Dec 24 17:42:56 2019 +0100
@@ -1013,7 +1013,7 @@
         pattern.setdefault('fiscalyear', fiscalyear.id)
         pattern.setdefault('period', period.id)
         invoice_type = self.type
-        if (all(l.amount < 0 for l in self.lines if l.product)
+        if (all(l.amount <= 0 for l in self.lines if l.product)
                 and self.total_amount < 0):
             invoice_type += '_credit_note'
         else:

Reply via email to