Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Margins in Sales Orders

Entity: sale.order.line

Compute Method: _compute_margin_percent

Inputs Method Outputs
for line in self:
            if line_subtotal := line._get_subtotal():
                line.margin_percent = float_round(line.margin / line_subtotal, precision_digits=4)
            else:
                line.margin_percent = None

Back to entity