[FIX] rma: dropship from vendor as outgoing

This commit is contained in:
DavidJForgeFlow
2023-05-02 09:34:46 +02:00
committed by JasminSForgeFlow
parent 79479530d9
commit ef1ab18b3b

View File

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