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_has_active_pricelist

View 19.0 View 20.0
Inputs Method Outputs
  • company_id
  • company_id.id
for order in self:
-             order.has_active_pricelist = bool(self.env['product.pricelist'].search(
-                 [('company_id', 'in', (False, order.company_id.id)), ('active', '=', True)],
-                 limit=1,
-             ))
+             order.has_active_pricelist = bool(
+                 self.env["product.pricelist"].search(
+                     [("company_id", "in", (False, order.company_id.id)), ("active", "=", True)],
+                     limit=1,
+                 )
+             )
  • has_active_pricelist

Back to entity