Do read amount value inside subtotal computation

The field can not be used because the server will read the values of all lines
in the invoice and cause a recursion error

issue10284
review363151002
This commit is contained in:
Sergi Almacellas Abellana committed 2021-04-15 10:10:55 +02:00
1 parent 4525f90d7f
commit 8d61e68c0b
1 file changed
+1 -1
+1 -1
View File
@@ -2042,7 +2042,7 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin):
subtotal = Decimal(0)
for line2 in self.invoice.lines:
if line2.type == 'line':
subtotal += line2.amount
subtotal += line2.on_change_with_amount()
elif line2.type == 'subtotal':
if self == line2:
break