[IMP] correctly handle writing to a view without a model_data (e.g. test views)

bzr revid: xmo@openerp.com-20131218134932-382cvndk8asr82ip
This commit is contained in:
Xavier Morel
2013-12-18 14:49:32 +01:00
parent 56f18f56c5
commit b741852c3d
+4 -5
View File
@@ -180,11 +180,10 @@ class view(osv.osv):
if not context.get('install_mode', False):
# touched views become noupdatable
for id in ids:
_view = self.browse(cr, uid, id, context=context)
_view.model_data_id.write({
'noupdate': True
})
# TODO: should be doable in a read and a write
for view_ in self.browse(cr, uid, ids, context=context):
if view_.model_data_id:
view_.model_data_id.write({'noupdate': True})
return ret
# default view selection