diff --git a/rma/wizards/rma_make_picking.py b/rma/wizards/rma_make_picking.py index ce79afa3..f2841609 100644 --- a/rma/wizards/rma_make_picking.py +++ b/rma/wizards/rma_make_picking.py @@ -102,17 +102,19 @@ class RmaMakePicking(models.TransientModel): def _get_procurement_data(self, item, group, qty, picking_type): line = item.line_id delivery_address_id = self._get_address(item) + location, warehouse, route = False, False, False if picking_type == "incoming": if line.customer_to_supplier: location = self._get_address_location(delivery_address_id, "supplier") - elif line.supplier_to_customer: - location = self._get_address_location(delivery_address_id, "customer") else: location = line.location_id warehouse = line.in_warehouse_id route = line.in_route_id - else: - location = self._get_address_location(delivery_address_id, line.type) + elif picking_type == "outgoing": + if line.supplier_to_customer: + location = self._get_address_location(delivery_address_id, "customer") + else: + location = self._get_address_location(delivery_address_id, line.type) warehouse = line.out_warehouse_id route = line.out_route_id if not route: