Adding a clause to not read inherit views in fields_view_get

bzr revid: fp@tinyerp.com-20080818221904-s3ssm41w8v1hykj6
This commit is contained in:
Fabien Pinckaers 2008-08-19 00:19:04 +02:00
parent 9ab39c25da
commit 1c00f10911
1 changed files with 9 additions and 1 deletions

View File

@ -968,7 +968,15 @@ class orm_template(object):
where = (model and (" and model='%s'" % (self._name,))) or ''
cr.execute('SELECT arch,name,field_parent,id,type,inherit_id FROM ir_ui_view WHERE id=%d'+where, (view_id,))
else:
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))
cr.execute('''SELECT
arch,name,field_parent,id,type,inherit_id
FROM
ir_ui_view
WHERE
model=%s AND
type=%s AND
inherit_id IS NULL
ORDER BY priority''', (self._name, view_type))
sql_res = cr.fetchone()
if not sql_res:
break