From e9dce2c7b655d0f0b2b1075c05a37a190f1f6473 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 28 Apr 2017 12:29:22 +0200 Subject: [FIX] web: don't fetch invisible relational fields Relational fields with attribute 'invisible' set to true are in views because they are used in domains or contexts. In this case their relational data is useless, only their ids matter. Before this rev., their relational data was fetched anyway. More precisely, it was the case for many2ones after a default_get, and for x2manys with inline views, or without view (e.g. with widget 'many2many_tags'). --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index f3e69a6b453..9bd33b90a3d 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1319,7 +1319,7 @@ var BasicModel = AbstractModel.extend({ // find all many2one related records to be fetched _.each(record.getFieldNames(), function (name) { var field = record.fields[name]; - if (field.type === 'many2one') { + if (field.type === 'many2one' && !record.fieldsInfo[record.viewType][name].__no_fetch) { var localId = (record._changes && record._changes[name]) || record.data[name]; var relatedRecord = self.localData[localId]; if (!relatedRecord) { -- cgit v1.2.3