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: account.move

Compute Method: _compute_display_auto_complete

View 20.0
Inputs Method Outputs
  • partner_id
  • partner_id.id
+ partner_ids = self.mapped('partner_id').ids
+ purchase_orders = self.env['purchase.order']._search([
+             ('state', '=', 'purchase'),
+             ('invoice_status', 'in', ('to invoice', 'no'))
+         ], limit=1)
+ purchase_orders.add_where(SQL('purchase_order.partner_id = res_partner.id'))
+ partners = self.env['res.partner']._search([
+             ('id', 'in', partner_ids),
+         ])
+ partners.add_where(SQL('EXISTS(%s)', purchase_orders.select()))
+ valid_partner_ids = {partner[0] for partner in self.env.execute_query(partners.select())}
+ for move in self:
+             move.display_auto_complete_field = move.partner_id.id in valid_partner_ids
  • display_auto_complete_field

Back to entity