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.picking

Compute Method: _compute_location_dest_id

Inputs Method Outputs
default_customer_location_id = self.env['ir.default'].sudo()._get('res.partner', 'property_stock_customer')
for picking in self:
            if picking.state in ('cancel', 'done') or picking.return_id:
                continue
            picking = picking.with_company(picking.company_id)
            if picking.picking_type_id:
                location_dest = picking.picking_type_id.default_location_dest_id
                if location_dest.usage == 'customer' and picking.partner_id:
                    customer_location = picking.partner_id.property_stock_customer
                    if customer_location and customer_location.id != default_customer_location_id:
                        location_dest = customer_location
                picking.location_dest_id = location_dest.id

Back to entity