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

Module: Field Service Sizes

Entity: fsm.order

Compute Method: _compute_size_value

Inputs Method Outputs
for rec in self:
            if not rec.size_id or not rec.location_id:
                rec.size_value = 0.00
                continue
            size = self.env["fsm.location.size"].search(
                Domain(
                    [
                        ("location_id", "=", rec.location_id.id),
                        ("size_id", "=", rec.size_id.id),
                    ]
                ),
                limit=1,
            )
            rec.size_value = size and size.quantity or 0.00

Back to entity