[FIX] stock: fixed logistic flow when resupplying from another warehouse (the warehouse propagated has sometimes to be different than the warehouse this rule serve)
bzr revid: qdp-launchpad@openerp.com-20131106083938-ucrdm6d64n9xzii8
This commit is contained in:
@@ -82,7 +82,8 @@ class procurement_rule(osv.osv):
|
||||
'delay': fields.integer('Number of Days'),
|
||||
'partner_address_id': fields.many2one('res.partner', 'Partner Address'),
|
||||
'propagate': fields.boolean('Propagate cancel and split', help='If checked, when the previous move of the move (which was generated by a next procurement) is cancelled or split, the move generated by this move will too'),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', help='The warehouse this rule is for'),
|
||||
'propagate_warehouse_id': fields.many2one('stock.warehouse', 'Warehouse to Propagate', help="The warehouse to propagate on the created move/procurement, which can be different of the warehosue this rule is for (e.g for resupplying rules from another warehouse)"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -185,7 +186,7 @@ class procurement_order(osv.osv):
|
||||
'picking_type_id': procurement.rule_id.picking_type_id.id,
|
||||
'group_id': procurement.group_id and procurement.group_id.id or False,
|
||||
'route_ids': [(4, x.id) for x in procurement.route_ids],
|
||||
'warehouse_id': procurement.rule_id.warehouse_id.id,
|
||||
'warehouse_id': procurement.rule_id.propagate_warehouse_id and procurement.rule_id.propagate_warehouse_id.id or procurement.rule_id.warehouse_id.id,
|
||||
}
|
||||
if procurement.rule_id:
|
||||
newdate = (datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - relativedelta(days=procurement.rule_id.delay or 0)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
@@ -2380,6 +2380,7 @@ class stock_warehouse(osv.osv):
|
||||
'picking_type_id': pick_type_id,
|
||||
'procure_method': 'make_to_order',
|
||||
'warehouse_id': supplied_warehouse.id,
|
||||
'propagate_warehouse_id': warehouse.id,
|
||||
})
|
||||
return pull_rules_list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user