From a197c914583ca859214580472408e7ca9b3ecf63 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 25 Jun 2015 15:02:47 +0200 Subject: [PATCH] [FIX] account: remove lang from context before move creation If an error message pops up during the move creation, we have to take the user's language and not the partner's language. Fixes #6902 Closes #6903 --- addons/account/account_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 52babde17af..79294085488 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1052,7 +1052,9 @@ class account_invoice(osv.osv): i[2]['period_id'] = period_id ctx.update(invoice=inv) - move_id = move_obj.create(cr, uid, move, context=ctx) + ctx_copy = ctx.copy() + ctx_copy.pop('lang', None) + move_id = move_obj.create(cr, uid, move, context=ctx_copy) new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name # make the invoice point to that move self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)