[REF] [MRP] action_produce_assign_product method refactoring: several mrp.production where made and not linked to their procurement only last id was returned. -> Not possible to override cleany for instance to pass custom options from a procurement to a production order. Implemented it with the {} trick. This is debatable whether {} links or hook before creation is better. At least now you can override it...

bzr revid: rvalyi@gmail.com-20100228035250-xnp9q1tx5j0sjnlr
This commit is contained in:
Raphaël Valyi 2010-02-28 00:52:50 -03:00
parent 6f74c8ed75
commit 353f7026a1
1 changed files with 3 additions and 2 deletions

View File

@ -1115,7 +1115,7 @@ class mrp_procurement(osv.osv):
return True
def action_produce_assign_product(self, cr, uid, ids, context={}):
produce_id = False
res = {}
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
@ -1136,6 +1136,7 @@ class mrp_procurement(osv.osv):
'move_prod_id': res_id,
'company_id': procurement.company_id.id,
})
res[procurement.id] = produce_id
self.write(cr, uid, [procurement.id], {'state':'running'})
bom_result = self.pool.get('mrp.production').action_compute(cr, uid,
[produce_id], properties=[x.id for x in procurement.property_ids])
@ -1143,7 +1144,7 @@ class mrp_procurement(osv.osv):
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
self.pool.get('stock.move').write(cr, uid, [res_id],
{'location_id':procurement.location_id.id})
return produce_id
return res
def action_po_assign(self, cr, uid, ids, context={}):
purchase_id = False