summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-05-25 13:13:56 +0000
committerVictor Feyens <vfe@odoo.com>2020-05-26 10:14:02 +0000
commita624567cd817eac8624ee03c6a1f1b3711fcded0 (patch)
treeb8b93838f8c14f6df6feb42467402a905367b127
parent66240a85363ff19f6ee2d40356f19754471a6133 (diff)
[FIX] pos_sale: sale.report discount_amount computation
The pos.order.line quantity wasn't considered when computing the discount amount. E.g. buying 5 products (1$) at 50% would only show 0.5$ as discount_amount, instead of 2.5$. Followup of #43587 closes odoo/odoo#51872 X-original-commit: 96e96284fceb2f68838c85f04c40da65176eb006 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
-rw-r--r--addons/pos_sale/report/sale_report.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/pos_sale/report/sale_report.py b/addons/pos_sale/report/sale_report.py
index 4618651ec2c..374013aad4f 100644
--- a/addons/pos_sale/report/sale_report.py
+++ b/addons/pos_sale/report/sale_report.py
@@ -62,7 +62,7 @@ class SaleReport(models.Model):
left join product_template t on (p.product_tmpl_id=t.id)
left join uom_uom u on (u.id=t.uom_id)) AS volume,
l.discount as discount,
- sum((l.price_unit * l.discount / 100.0 / CASE COALESCE(pos.currency_rate, 0) WHEN 0 THEN 1.0 ELSE pos.currency_rate END)) as discount_amount,
+ sum((l.price_unit * l.discount * l.qty / 100.0 / CASE COALESCE(pos.currency_rate, 0) WHEN 0 THEN 1.0 ELSE pos.currency_rate END)) as discount_amount,
NULL as order_id
'''