Skip to content
Snippets Groups Projects
Commit abdb85fb authored by Achraf (abz)'s avatar Achraf (abz)
Browse files

[FIX] sale_margin: Correct computation of margin in groupby


For now the sale margin is incorrectly computed in group by

opw-2767397

closes odoo/odoo#85774

Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent 54e54466
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ class SaleOrderLine(models.Model):
"Margin", compute='_compute_margin',
digits='Product Price', store=True, groups="base.group_user")
margin_percent = fields.Float(
"Margin (%)", compute='_compute_margin', store=True, groups="base.group_user")
"Margin (%)", compute='_compute_margin', store=True, groups="base.group_user", group_operator="avg")
purchase_price = fields.Float(
string='Cost', compute="_compute_purchase_price",
digits='Product Price', store=True, readonly=False,
......
......@@ -55,4 +55,15 @@
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_pivot">
<field name="name">sale.order.margin.view.graph</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sale_order_graph"/>
<field name="arch" type="xml">
<graph position="inside">
<field name="margin_percent" invisible="1"/>
</graph>
</field>
</record>
</odoo>
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