[FIX] mrp: Manufacture Order Sequence
The name of the manufacture order created must include the sequence linked to the company of the salesperson. opw:632600
This commit is contained in:
parent
612b44648e
commit
44fecec058
|
@ -594,7 +594,7 @@ class mrp_production(osv.osv):
|
|||
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'product_qty': lambda *a: 1.0,
|
||||
'user_id': lambda self, cr, uid, c: uid,
|
||||
'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',
|
||||
'name': lambda self, cr, uid, context: self.pool['ir.sequence'].get(cr, uid, 'mrp.production', context=context) or '/',
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
|
||||
'location_src_id': _src_id_default,
|
||||
'location_dest_id': _dest_id_default
|
||||
|
|
|
@ -116,7 +116,7 @@ class procurement_order(osv.osv):
|
|||
if self.check_bom_exists(cr, uid, [procurement.id], context=context):
|
||||
#create the MO as SUPERUSER because the current user may not have the rights to do it (mto product launched by a sale for example)
|
||||
vals = self._prepare_mo_vals(cr, uid, procurement, context=context)
|
||||
produce_id = production_obj.create(cr, SUPERUSER_ID, vals, context=context)
|
||||
produce_id = production_obj.create(cr, SUPERUSER_ID, vals, context=dict(context, force_company=procurement.company_id.id))
|
||||
res[procurement.id] = produce_id
|
||||
self.write(cr, uid, [procurement.id], {'production_id': produce_id})
|
||||
self.production_order_create_note(cr, uid, procurement, context=context)
|
||||
|
|
Loading…
Reference in New Issue