From 1aed46d2a8f8c5771cd6da7ddcf508726b8b3a0b Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 20 Apr 2015 08:39:07 +0200 Subject: [PATCH] [FIX] mail: Work order translation The action_confirm function losses the context when called by a workflow. To have the right translation, the lang of the user must be written in the context. opw:632873 --- addons/mrp/mrp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index e85846603e4..8c7673a7e3d 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -724,7 +724,7 @@ class mrp_production(osv.osv): #reset workcenter_lines in production order for line in results2: line['production_id'] = production.id - workcenter_line_obj.create(cr, uid, line) + workcenter_line_obj.create(cr, uid, line, context) return results def action_compute(self, cr, uid, ids, properties=None, context=None): @@ -1221,6 +1221,8 @@ class mrp_production(osv.osv): """ Confirms production order. @return: Newly generated Shipment Id. """ + user_lang = self.pool.get('res.users').browse(cr, uid, [uid]).partner_id.lang + context = dict(context, lang=user_lang) uncompute_ids = filter(lambda x: x, [not x.product_lines and x.id or False for x in self.browse(cr, uid, ids, context=context)]) self.action_compute(cr, uid, uncompute_ids, context=context) for production in self.browse(cr, uid, ids, context=context):