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

Inputs Method Outputs
for line in self:
            total_cost = line.purchase_price * line._get_product_qty()
            line.margin = line._get_subtotal() - total_cost

Back to entity