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

Module: Stock Picking Kind

Entity: stock.picking

Compute Method: _compute_picking_kind

Inputs Method Outputs
  • location_id
  • location_id.usage
  • location_dest_id
  • location_dest_id.usage
for rec in self:
            if (
                rec.location_id.usage == "supplier"
                and rec.location_dest_id.usage == "customer"
            ):
                rec.picking_kind = "drop_shipping"
            elif (
                rec.location_id.usage == "customer"
                and rec.location_dest_id.usage == "supplier"
            ):
                rec.picking_kind = "drop_shipping_return"
            elif (
                rec.location_id.usage == "customer"
                and rec.location_dest_id.usage != "customer"
            ):
                rec.picking_kind = "customer_return"
            elif (
                rec.location_id.usage != "customer"
                and rec.location_dest_id.usage == "customer"
            ):
                rec.picking_kind = "customer_out"
            elif (
                rec.location_id.usage == "supplier"
                and rec.location_dest_id.usage != "supplier"
            ):
                rec.picking_kind = "supplier_in"
            elif (
                rec.location_id.usage != "supplier"
                and rec.location_dest_id.usage == "supplier"
            ):
                rec.picking_kind = "supplier_return"
            else:
                rec.picking_kind = False

Back to entity