Bugfixed for add shortcuts
bzr revid: hda@tinyerp.com-20080923053621-ix9fhxcwzcccbf3x
This commit is contained in:
parent
c3b84c01d6
commit
5bd1f2197b
|
@ -79,28 +79,28 @@ class view(osv.osv):
|
|||
_constraints = [
|
||||
(_check_xml, 'Invalid XML for View Architecture!', ['arch'])
|
||||
]
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
for rs in result:
|
||||
if rs.get('model') == 'board.board':
|
||||
cr.execute("select id,arch,ref_id from ir_ui_view_custom where user_id=%d and ref_id=%d", (uid, rs['id']))
|
||||
oview = cr.dictfetchall()
|
||||
if oview:
|
||||
rs['arch'] = oview[0]['arch']
|
||||
|
||||
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
|
||||
if not isinstance(ids, (list, tuple)):
|
||||
ids = [ids]
|
||||
ids = [ids]
|
||||
|
||||
exist = self.pool.get('ir.ui.view').browse(cr, uid, ids[0])
|
||||
if exist.model == 'board.board' and 'arch' in vals:
|
||||
|
@ -124,7 +124,7 @@ class view_sc(osv.osv):
|
|||
_name = 'ir.ui.view_sc'
|
||||
_columns = {
|
||||
'name': fields.char('Shortcut Name', size=64, required=True),
|
||||
'res_id': fields.many2one('ir.values','Resource Ref.', ondelete='cascade'),
|
||||
'res_id': fields.many2one('ir.ui.menu','Resource Ref.', ondelete='cascade'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'user_id': fields.many2one('res.users', 'User Ref.', required=True, ondelete='cascade'),
|
||||
'resource': fields.char('Resource Name', size=64, required=True)
|
||||
|
|
Loading…
Reference in New Issue