diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-04-28 12:29:22 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-05-02 15:34:43 +0200 |
| commit | e9dce2c7b655d0f0b2b1075c05a37a190f1f6473 (patch) | |
| tree | 031739608caa788116098a8caefcb63c0c1fac51 /addons/web/static/src/js/views/basic | |
| parent | d99ae3fd87aa07a1d7e201dbcd2defd144dfdec3 (diff) | |
[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').
Diffstat (limited to 'addons/web/static/src/js/views/basic')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |
