mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[14.0][FIX] warehouse rma location
This commit is contained in:
committed by
Florian da Costa
parent
ddecc1dac9
commit
ce3faa653e
@@ -498,14 +498,21 @@ class RmaOrderLine(models.Model):
|
||||
if not route:
|
||||
raise ValidationError(_("Please define an RMA route."))
|
||||
|
||||
if not operation.in_warehouse_id or not operation.out_warehouse_id:
|
||||
if (
|
||||
not operation.in_warehouse_id
|
||||
or not operation.out_warehouse_id
|
||||
or not (
|
||||
operation.in_warehouse_id.lot_rma_id
|
||||
or operation.out_warehouse_id.lot_rma_id
|
||||
)
|
||||
):
|
||||
warehouse = self.env["stock.warehouse"].search(
|
||||
[("company_id", "=", self.company_id.id), ("lot_rma_id", "!=", False)],
|
||||
limit=1,
|
||||
)
|
||||
if not warehouse:
|
||||
raise ValidationError(
|
||||
_("Please define a warehouse with a default RMA " "location.")
|
||||
_("Please define a warehouse with a default RMA location.")
|
||||
)
|
||||
|
||||
data = {
|
||||
@@ -525,6 +532,7 @@ class RmaOrderLine(models.Model):
|
||||
"location_id": (
|
||||
operation.location_id.id
|
||||
or operation.in_warehouse_id.lot_rma_id.id
|
||||
or operation.out_warehouse_id.lot_rma_id.id
|
||||
or warehouse.lot_rma_id.id
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user