Skip to content
Snippets Groups Projects
Commit 0301eee0 authored by Victor Feyens's avatar Victor Feyens
Browse files

[FIX] sale: discount_amount in sale report


The discount_amount didn't consider the quantity on Sales Order Line.

e.g:

100€ | 10% discount | 8 products

--> discount_amount was 10 € instead of 80€

Fixes #43242

closes odoo/odoo#43613

X-original-commit: b8a1370c
Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent 52a3b611
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ class SaleReport(models.Model):
sum(p.weight * l.product_uom_qty / u.factor * u2.factor) as weight,
sum(p.volume * l.product_uom_qty / u.factor * u2.factor) as volume,
l.discount as discount,
sum((l.price_unit * l.discount / 100.0 / CASE COALESCE(s.currency_rate, 0) WHEN 0 THEN 1.0 ELSE s.currency_rate END)) as discount_amount,
sum((l.price_unit * l.product_uom_qty * l.discount / 100.0 / CASE COALESCE(s.currency_rate, 0) WHEN 0 THEN 1.0 ELSE s.currency_rate END)) as discount_amount,
s.id as order_id
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment