From b92e3792cf68b4aaac5651e9e6d82072cdc9fdf4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 31 Aug 2011 16:30:02 +0200 Subject: [PATCH] [IMP] stop performing useless fields_get requests for every relational field of a model bzr revid: xmo@openerp.com-20110831143002-dvsxq6aaf7dk04i1 --- addons/base/controllers/main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index 9d215cb2f82..e18abc56d1e 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -1117,12 +1117,10 @@ class Export(View): if len(name.split('/')) < 3 and 'relation' in field: ref = field.pop('relation') record['params'] = {'model': ref, 'prefix': id, 'name': name} - if import_compat and field['type'] in ('many2one', 'many2many'): - # m2m remains childless - if field['type'] == 'many2one': - record['children'] = True - else: - record['children'] = bool(self.fields_get(req, ref)) + + if not (import_compat and field['type'] == 'many2many'): + # m2m field in import_compat is childless + record['children'] = True return records