Merge lp:~openerp-dev/openobject-addons/7.0-opw-590710-nep into lp:openobject-addons/7.0

Proposed by Nehal Panchal (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-590710-nep
Merge into: lp:openobject-addons/7.0
Diff against target: 11 lines (+1/-0)
1 file modified
account/account.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-590710-nep
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+158551@code.launchpad.net

Description of the change

Hello,

While validating the Refund invoice which has different company for invoice line and account or for invoice line and period, validate error message appears in partner's language. This message should be in the user's language.

This fixes the issue.

Thanks

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

Your fix do solve the problem, but hides the actual root cause, which was introduced at 5936.4.7 <email address hidden> which sets the invoice's partner language in the context instead of the user language as there is no meaning in setting the partner language here.

So as a root fix you need to change the context setting in account/account_invoice.py in def action_move_create @line 910 * ctx.update({'lang': inv.partner_id.lang})* replace this by the language of the current user as you did here. This way the correct lang will be passed in the subsequent calls throughout the flow.

Thanks,
Naresh Soni,
OpenERP Enterprise Services

review: Needs Fixing

Unmerged revisions

9012. By Nehal Panchal (OpenERP)

[FIX] account : while validating Customer refund,Validate error should display in user's language

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2013-04-04 09:09:48 +0000
3+++ account/account.py 2013-04-12 10:09:25 +0000
4@@ -1372,6 +1372,7 @@
5 def create(self, cr, uid, vals, context=None):
6 if context is None:
7 context = {}
8+ context['lang'] = self.pool.get('res.users').context_get(cr, uid, context)['lang']
9 if 'line_id' in vals and context.get('copy'):
10 for l in vals['line_id']:
11 if not l[0]: