[FIX] ir_ui_view: still usign context without being sure it exists

bzr revid: tde@openerp.com-20131218105511-fuf8ca99nimzbcpc
This commit is contained in:
Thibault Delavallée 2013-12-18 11:55:11 +01:00
parent 7ddfe4c5c6
commit 56f18f56c5
1 changed files with 3 additions and 1 deletions

View File

@ -166,10 +166,12 @@ class view(osv.osv):
def write(self, cr, uid, ids, vals, context=None):
if not isinstance(ids, (list, tuple)):
ids = [ids]
if context is None:
context = {}
# drop the corresponding view customizations (used for dashboards for example), otherwise
# not all users would see the updated views
custom_view_ids = self.pool.get('ir.ui.view.custom').search(cr, uid, [('ref_id','in',ids)])
custom_view_ids = self.pool.get('ir.ui.view.custom').search(cr, uid, [('ref_id', 'in', ids)])
if custom_view_ids:
self.pool.get('ir.ui.view.custom').unlink(cr, uid, custom_view_ids)