[IMP] stock: change the dest location of product on state change

-the location of the scrapping product was set to its default vendor
location, it should be destination location.

task-1959647
This commit is contained in:
Shreya Modi
2019-08-23 12:42:40 +00:00
parent 48ed021334
commit 47219e96e1
+1 -1
View File
@@ -73,7 +73,7 @@ class StockScrap(models.Model):
if self.picking_id:
for move_line in self.picking_id.move_line_ids:
if move_line.product_id == self.product_id:
self.location_id = move_line.location_id
self.location_id = move_line.location_id if move_line.state != 'done' else move_line.location_dest_id
break
def unlink(self):