* Bug-Fix for the Dashboard

- changein write method of the ir.ui.view

bzr revid: mga@tinyerp.com-20080821112425-hbkppvql30kmum9t
This commit is contained in:
mga@tinyerp.com 2008-08-21 16:54:25 +05:30
parent c1d400209f
commit bb31f33da6
1 changed files with 4 additions and 2 deletions

View File

@ -80,12 +80,13 @@ class view(osv.osv):
(_check_xml, 'Invalid XML for View Architecture!', ['arch'])
]
def read(self,cr, uid, ids, fields=None, context={}, load='_classic_read'):
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'):
if not isinstance(ids, (list, tuple)):
ids = [ids]
result = super(view, self).read(cr, uid, ids, fields, context, load)
print '************************** : ',result
for rs in result:
if rs.get('model') == 'board.board':
@ -94,6 +95,7 @@ class view(osv.osv):
if oview:
rs['arch'] = oview[0]['arch']
return result
def write(self, cr, uid, ids, vals, context={}):
@ -107,7 +109,7 @@ class view(osv.osv):
vals2 = {'user_id': uid, 'ref_id': ids[0], 'arch': vals.pop('arch')}
# write fields except arch to the `ir.ui.view`
result = super(view, self).write(cr, uid, vids, vals, context)
result = super(view, self).write(cr, uid, ids, vals, context)
if not vids:
self.pool.get('ir.ui.view.custom').create(cr, uid, vals2)