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

Module: Purchase Free-Of-Payment shipping

Entity: purchase.order

Compute Method: _compute_fop_shipping_reached

Inputs Method Outputs
  • amount_total
  • partner_id
  • partner_id.fop_shipping
digit_precision = self.env["decimal.precision"].precision_get("Account")
for record in self:
            if (
                float_compare(record.amount_total, 0, precision_digits=digit_precision)
                < 0
            ):
                record.fop_reached = True
                continue
            record.fop_reached = (
                float_compare(
                    record.amount_total,
                    record.partner_id.fop_shipping,
                    precision_digits=digit_precision,
                )
                >= 0
            )

Back to entity