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

Module: Sales

Entity: sale.order

Compute Method: _compute_fiscal_position_id

Inputs Method Outputs
cache = {}
for order in self:
            if not order.partner_id:
                order.fiscal_position_id = False
                continue
            key = (order.company_id.id, order.partner_id.id, order.partner_shipping_id.id)
            if key not in cache:
                cache[key] = (
                    self
                    .env["account.fiscal.position"]
                    .with_company(order.company_id)
                    ._get_fiscal_position(order.partner_id, order.partner_shipping_id)
                    .id
                )
            order.fiscal_position_id = cache[key]

Back to entity