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

Module: Inventory

Entity: stock.warehouse.orderpoint

Compute Method: _compute_warehouse_id

View 17.0 View 18.0
Inputs Method Outputs
  • location_id
  • location_id.warehouse_id
  • company_id
  • company_id.id
  • warehouse_id
for orderpoint in self:
            if orderpoint.location_id.warehouse_id:
                orderpoint.warehouse_id = orderpoint.location_id.warehouse_id
            elif orderpoint.company_id:
                orderpoint.warehouse_id = orderpoint.env['stock.warehouse'].search([
                    ('company_id', '=', orderpoint.company_id.id)
                ], limit=1)
+             if not orderpoint.warehouse_id:
+                 self.env['stock.warehouse']._warehouse_redirect_warning()
  • warehouse_id

Back to entity