[FIX] sale: Amount Invoiced in Sales Analysis

This commit is contained in:
Andrea
2018-08-06 09:52:04 +02:00
committed by Lucas Perais
parent 39f19d14f0
commit 85e8d13768
+2 -1
View File
@@ -735,7 +735,8 @@ class SaleOrderLine(models.Model):
# Total invoiced amount
invoiced_amount_total = sum(invoice_lines.mapped('price_total'))
# Total refunded amount
refund_amount_total = sum(refund_invoices.mapped('amount_total'))
refund_invoice_lines = refund_invoices.mapped('invoice_line_ids').filtered(lambda l: l.product_id == line.product_id)
refund_amount_total = sum(refund_invoice_lines.mapped('price_total'))
# Total of remaining amount to invoice on the sale ordered (and draft invoice included) to support upsell (when
# delivered quantity is higher than ordered one). Draft invoice are ignored on purpose, the 'to invoice' should
# come only from the SO lines.