Fix amount calculation in supplier invoices with moves browsed multiple times
get_amount function must process invoices only one time (despite passed more than one time) because supplier invoices total_amount is multiplied by -1 when it has accounting moves and if multiplied 2 (or any pair number) times it returns the amount in the wrong sign. issue3711 review3791002
This commit is contained in:
+4
-4
@@ -568,13 +568,13 @@ class Invoice(Workflow, ModelSQL, ModelView):
|
||||
tax_amount[invoice.id] = invoice.currency.round(
|
||||
tax_amount[invoice.id])
|
||||
|
||||
invoices_move = []
|
||||
invoices_no_move = []
|
||||
invoices_move = set()
|
||||
invoices_no_move = set()
|
||||
for invoice in invoices:
|
||||
if invoice.move:
|
||||
invoices_move.append(invoice.id)
|
||||
invoices_move.add(invoice.id)
|
||||
else:
|
||||
invoices_no_move.append(invoice.id)
|
||||
invoices_no_move.add(invoice.id)
|
||||
invoices_move = cls.browse(invoices_move)
|
||||
invoices_no_move = cls.browse(invoices_no_move)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user