summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2013-08-28 11:54:43 +0200
committerFabien Pinckaers <fp@tinyerp.com>2013-08-28 11:54:43 +0200
commit53824ea842600b7cb1bb2a2b36bc5069bdd18eaa (patch)
treef6f73e7ec41687c5b367ea07c08f27cd876658b7
parentf60bd37d5766c666a70a14dbca65066aacaf6556 (diff)
[MERGE] forward port fix from trunk for access rights on /shop
bzr revid: fp@tinyerp.com-20130828095443-pxll7f4cx8g20flm
-rw-r--r--openerp/osv/orm.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index e9c857d1f3b..829ba6a2bde 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -383,16 +383,18 @@ class browse_record(object):
raise KeyError(error_msg)
# if the field is a classic one or a many2one, we'll fetch all classic and many2one fields
- if col._prefetch:
+ if col._prefetch and not col.groups:
# gen the list of "local" (ie not inherited) fields which are classic or many2one
- fields_to_fetch = filter(lambda x: x[1]._classic_write and x[1]._prefetch, self._table._columns.items())
+ field_filter = lambda x: x[1]._classic_write and x[1]._prefetch and not x[1].groups
+ fields_to_fetch = filter(field_filter, self._table._columns.items())
# gen the list of inherited fields
inherits = map(lambda x: (x[0], x[1][2]), self._table._inherit_fields.items())
# complete the field list with the inherited fields which are classic or many2one
- fields_to_fetch += filter(lambda x: x[1]._classic_write and x[1]._prefetch, inherits)
+ fields_to_fetch += filter(field_filter, inherits)
# otherwise we fetch only that field
else:
fields_to_fetch = [(name, col)]
+
ids = filter(lambda id: name not in self._data[id], self._data.keys())
# read the results
field_names = map(lambda x: x[0], fields_to_fetch)