[FIX] Correct resupply pull rules to have the correct warehouses to propagate / serve so it works with MTO rules also
This commit is contained in:
parent
e07309d809
commit
d849c55599
|
@ -2945,7 +2945,7 @@ class stock_warehouse(osv.osv):
|
||||||
inter_wh_route_vals = self._get_inter_wh_route(cr, uid, warehouse, wh, context=context)
|
inter_wh_route_vals = self._get_inter_wh_route(cr, uid, warehouse, wh, context=context)
|
||||||
inter_wh_route_id = route_obj.create(cr, uid, vals=inter_wh_route_vals, context=context)
|
inter_wh_route_id = route_obj.create(cr, uid, vals=inter_wh_route_vals, context=context)
|
||||||
values = [(output_loc, transit_location, wh.out_type_id.id, wh), (transit_location, input_loc, warehouse.in_type_id.id, warehouse)]
|
values = [(output_loc, transit_location, wh.out_type_id.id, wh), (transit_location, input_loc, warehouse.in_type_id.id, warehouse)]
|
||||||
pull_rules_list = self._get_supply_pull_rules(cr, uid, warehouse, values, inter_wh_route_id, context=context)
|
pull_rules_list = self._get_supply_pull_rules(cr, uid, wh.id, values, inter_wh_route_id, context=context)
|
||||||
for pull_rule in pull_rules_list:
|
for pull_rule in pull_rules_list:
|
||||||
pull_obj.create(cr, uid, vals=pull_rule, context=context)
|
pull_obj.create(cr, uid, vals=pull_rule, context=context)
|
||||||
#if the warehouse is also set as default resupply method, assign this route automatically to the warehouse
|
#if the warehouse is also set as default resupply method, assign this route automatically to the warehouse
|
||||||
|
@ -3006,7 +3006,7 @@ class stock_warehouse(osv.osv):
|
||||||
'sequence': 10,
|
'sequence': 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_supply_pull_rules(self, cr, uid, supplied_warehouse, values, new_route_id, context=None):
|
def _get_supply_pull_rules(self, cr, uid, supply_warehouse, values, new_route_id, context=None):
|
||||||
pull_rules_list = []
|
pull_rules_list = []
|
||||||
for from_loc, dest_loc, pick_type_id, warehouse in values:
|
for from_loc, dest_loc, pick_type_id, warehouse in values:
|
||||||
pull_rules_list.append({
|
pull_rules_list.append({
|
||||||
|
@ -3017,8 +3017,8 @@ class stock_warehouse(osv.osv):
|
||||||
'action': 'move',
|
'action': 'move',
|
||||||
'picking_type_id': pick_type_id,
|
'picking_type_id': pick_type_id,
|
||||||
'procure_method': warehouse.lot_stock_id.id != from_loc.id and 'make_to_order' or 'make_to_stock', # first part of the resuply route is MTS
|
'procure_method': warehouse.lot_stock_id.id != from_loc.id and 'make_to_order' or 'make_to_stock', # first part of the resuply route is MTS
|
||||||
'warehouse_id': supplied_warehouse.id,
|
'warehouse_id': warehouse.id,
|
||||||
'propagate_warehouse_id': warehouse.id,
|
'propagate_warehouse_id': supply_warehouse,
|
||||||
})
|
})
|
||||||
return pull_rules_list
|
return pull_rules_list
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue