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

Module: Purchase

Entity: purchase.order

Compute Method: _compute_show_comparison

View 20.0
Inputs Method Outputs
  • order_line
  • order_line.product_id
  • order_line.product_id.ids
+ line_groupby_product = self.env['purchase.order.line']._read_group(
+             [('product_id', 'in', self.order_line.product_id.ids), ('state', '=', 'purchase')],
+             ['product_id'],
+             ['order_id:array_agg']
+         )
+ order_by_product = {p: set(o_ids) for p, o_ids in line_groupby_product}
+ for record in self:
+             record.show_comparison = any(set(record.ids) != order_by_product[p] for p in record.order_line.product_id if p in order_by_product)
  • show_comparison

Back to entity