Small changes according to the E-Tiny for View Customization

bzr revid: mga@tinyerp.com-75b0e0e17648aa58e4ae40ecf464009806612bf8
This commit is contained in:
Mantavya Gajjar
2008-07-07 04:47:46 +00:00
parent 7197572bf1
commit e5c44d7b16
+9 -6
View File
@@ -967,10 +967,11 @@ class orm_template(object):
while ok:
sql_res_usr = None
if view_id:
#check for user specific view and get the view according to that
where = (model and (" and model='%s'" % (self._name,))) or ''
cr.execute('select arch,name,field_parent,ref_id,type,inherit_id from ir_ui_view_user where ref_id=%d and user_id=%d'+where, (view_id, user))
sql_res_usr = cr.fetchone()
if context.get('global_view', False) == 1 or context.get('global_view', False) == True :
#check for user specific view and get the view according to that
where = (model and (" and model='%s'" % (self._name,))) or ''
cr.execute('select arch,name,field_parent,ref_id,type,inherit_id from ir_ui_view_user where ref_id=%d and user_id=%d'+where, (view_id, user))
sql_res_usr = cr.fetchone()
if not sql_res_usr:
where = (model and (" and model='%s'" % (self._name,))) or ''
@@ -978,8 +979,10 @@ class orm_template(object):
else:
base = True
else:
cr.execute('select arch,name,field_parent,ref_id,type,inherit_id from ir_ui_view_user where model=%s and type=%s and user_id=%d order by priority', (self._name, view_type, user))
sql_res_usr = cr.fetchone()
if context.get('global_view', False) == 1 or context.get('global_view', False) == True :
cr.execute('select arch,name,field_parent,ref_id,type,inherit_id from ir_ui_view_user where model=%s and type=%s and user_id=%d order by priority', (self._name, view_type, user))
sql_res_usr = cr.fetchone()
if not sql_res_usr:
cr.execute('select arch,name,field_parent,id,type,inherit_id from ir_ui_view where model=%s and type=%s order by priority', (self._name,view_type))
else: