Skip to content
Snippets Groups Projects
Commit 8f681585 authored by nie's avatar nie
Browse files

[FIX] sale_margin: confusing margin percentage in pivot


Steps to reproduce the bug:
- Activate Margins in Sales > Settings
- Go to the pivot view of quotations
- In Measures, click Margin (%)

Bug:
Margin percentages are aggregated by computing the sum of the margin sub-percentages instead of using the data of the aggregated row (i.e. agg. margin / agg. total).

Explanation:
This is one of the flaws of the pivot view. The best way to solve this would be to create a custom aggregation in PostgreSQL.
This commit is just hiding the measure for now.

opw:2349896

closes odoo/odoo#60354

X-original-commit: 1e3fc6894b13d51a3f6327653afbf8d5a316a21d
Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
parent 2355300b
Branches
Tags
No related merge requests found
......@@ -44,4 +44,15 @@
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_pivot">
<field name="name">sale.order.margin.view.pivot</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sale_order_pivot"/>
<field name="arch" type="xml">
<pivot position="inside">
<field name="margin_percent" invisible="1"/>
</pivot>
</field>
</record>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment