changeset 7f12f0f08c95 in modules/account_invoice:5.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=7f12f0f08c95
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 59119d38bee9 -r 7f12f0f08c95 invoice.py
--- a/invoice.py        Mon Dec 02 20:56:59 2019 +0100
+++ b/invoice.py        Tue Dec 24 17:42:56 2019 +0100
@@ -1019,7 +1019,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