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