[FIX] ir_ui_view: still usign context without being sure it exists
bzr revid: tde@openerp.com-20131218105511-fuf8ca99nimzbcpc
This commit is contained in:
parent
7ddfe4c5c6
commit
56f18f56c5
|
@ -166,10 +166,12 @@ class view(osv.osv):
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
if not isinstance(ids, (list, tuple)):
|
if not isinstance(ids, (list, tuple)):
|
||||||
ids = [ids]
|
ids = [ids]
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
|
|
||||||
# drop the corresponding view customizations (used for dashboards for example), otherwise
|
# drop the corresponding view customizations (used for dashboards for example), otherwise
|
||||||
# not all users would see the updated views
|
# 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:
|
if custom_view_ids:
|
||||||
self.pool.get('ir.ui.view.custom').unlink(cr, uid, custom_view_ids)
|
self.pool.get('ir.ui.view.custom').unlink(cr, uid, custom_view_ids)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue