Public bug reported:

When a record is updated, then the tracking features 
1. collects the old values
2. performs the write
3. collects the new values
4. Writes the changes to history

This is done in  write() of mail_thread.py.

If the 'lang' is not provided then in point 1 the 'lang' of the user is used to 
translated the changes (e.g. selection field).
But in point 3 the context without the 'lang' is used and therefore OpenERP 
always uses English.

Solution:
Also use "track_ctx" after the write:
----------------
        if not context.get('mail_notrack'):
            # Perform the tracking
            #tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), 
context=context)
            tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), 
context=track_ctx)
-----------------

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1320213

Title:
  Wrong lang in context when tracking changes

Status in OpenERP Addons (modules):
  New

Bug description:
  When a record is updated, then the tracking features 
  1. collects the old values
  2. performs the write
  3. collects the new values
  4. Writes the changes to history

  This is done in  write() of mail_thread.py.

  If the 'lang' is not provided then in point 1 the 'lang' of the user is used 
to translated the changes (e.g. selection field).
  But in point 3 the context without the 'lang' is used and therefore OpenERP 
always uses English.

  Solution:
  Also use "track_ctx" after the write:
  ----------------
          if not context.get('mail_notrack'):
              # Perform the tracking
              #tracked_fields = self._get_tracked_fields(cr, uid, 
values.keys(), context=context)
              tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), 
context=track_ctx)
  -----------------

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1320213/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~openerp-india
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-india
More help   : https://help.launchpad.net/ListHelp

Reply via email to