[FIX] rma: return location

The new implementation wasn't getting the value set in the wizard.

TT32046
This commit is contained in:
david
2021-09-23 11:56:25 +02:00
parent 0d0df215db
commit 425432efda

View File

@@ -889,12 +889,6 @@ class Rma(models.Model):
# Reception business methods
def _create_receptions_from_picking(self):
self.ensure_one()
create_vals = {}
if self.location_id:
create_vals.update(
location_id=self.location_id.id,
picking_id=self.picking_id.id,
)
stock_return_picking_form = Form(
self.env["stock.return.picking"].with_context(
active_ids=self.picking_id.ids,
@@ -902,6 +896,8 @@ class Rma(models.Model):
active_model="stock.picking",
)
)
if self.location_id:
stock_return_picking_form.location_id = self.location_id
return_wizard = stock_return_picking_form.save()
return_wizard.product_return_moves.filtered(
lambda r: r.move_id != self.move_id