diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 9d2a7fc38d4..fa28986a05e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -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 diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 71aae2be711..dd14cd89c93 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -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)