[FIX] stock: change delivery method on a supplied warehouse
Use case to reproduce: - Create multiple warehouse - Select a warehouse to ressuply on a warehouse form view - Go to the supplied warehouse form view - Change the delivery method -> Traceback can't adapt stock.location type This happens because there is a write method using a stock location instead of its id. This commit use the location id instead of location
This commit is contained in:
@@ -552,7 +552,7 @@ class Warehouse(models.Model):
|
||||
routes = self.env['stock.location.route'].search([('supplier_wh_id', '=', self.id)])
|
||||
pulls = Pull.search(['&', ('route_id', 'in', routes.ids), ('location_id.usage', '=', 'transit')])
|
||||
pulls.write({
|
||||
'location_src_id': new_location,
|
||||
'location_src_id': new_location.id,
|
||||
'procure_method': change_to_multiple and "make_to_order" or "make_to_stock"})
|
||||
if not change_to_multiple:
|
||||
# If single delivery we should create the necessary MTO rules for the resupply
|
||||
|
||||
Reference in New Issue
Block a user