[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,15 +102,17 @@ class RmaMakePicking(models.TransientModel):
def _get_procurement_data(self, item, group, qty, picking_type): def _get_procurement_data(self, item, group, qty, picking_type):
line = item.line_id line = item.line_id
delivery_address_id = self._get_address(item) delivery_address_id = self._get_address(item)
location, warehouse, route = False, False, False
if picking_type == "incoming": if picking_type == "incoming":
if line.customer_to_supplier: if line.customer_to_supplier:
location = self._get_address_location(delivery_address_id, "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: else:
location = line.location_id location = line.location_id
warehouse = line.in_warehouse_id warehouse = line.in_warehouse_id
route = line.in_route_id route = line.in_route_id
elif picking_type == "outgoing":
if line.supplier_to_customer:
location = self._get_address_location(delivery_address_id, "customer")
else: else:
location = self._get_address_location(delivery_address_id, line.type) location = self._get_address_location(delivery_address_id, line.type)
warehouse = line.out_warehouse_id warehouse = line.out_warehouse_id