Skip to content

Commit

Permalink
[FIX] ir.values: clear defaults cache when user company changes
Browse files Browse the repository at this point in the history
The defaults of ir.values depends on the user company, but there is no
cache invalidation when the company of a user change.

This fix adds the clearing of the default's cache in this case.

Closes #6339
opw-629979
  • Loading branch information
nle-odoo authored and odony committed Apr 22, 2015
1 parent 8c40bdd commit a8c122c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openerp/addons/base/res/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ def write(self, cr, uid, ids, values, context=None):
# if partner is global we keep it that way
if user.partner_id.company_id and user.partner_id.company_id.id != values['company_id']:
user.partner_id.write({'company_id': user.company_id.id})
# clear default ir values when company changes
self.pool['ir.values'].get_defaults_dict.clear_cache(self.pool['ir.values'])
# clear caches linked to the users
self.pool['ir.model.access'].call_cache_clearing_methods(cr)
clear = partial(self.pool['ir.rule'].clear_cache, cr)
Expand Down

0 comments on commit a8c122c

Please sign in to comment.