From 2a5488619da22cfd901963dd141e722b195e82ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Ku=CC=88hn?= Date: Sun, 14 Jan 2018 21:34:13 +0100 Subject: [FIX] web: disable {bin_size: true} on binary fields Revision on 41fe7f9d1113d026b226b136b4477aaaf9f1f638 This commit intended to reduce the network load when reading records with binary fields. This was made possible by enforcing the contextual key `bin_size` to be set for records with binary fields. However, it is causing some issues (see #22222, #22231) which are: - write with bin_size:true generates a traceback - read/search_read with bin_size:true breaks some images on some views (e.g. base.view_partner_form) Since the problems outweight the gain of these changes, we revert them. --- addons/web/static/src/js/views/basic/basic_model.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (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 a6979776c99..d7fbee2b30d 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1854,7 +1854,7 @@ var BasicModel = AbstractModel.extend({ model: record.model, method: 'read', args: [[record.res_id], fieldNames], - context: record.getContext(), + context: _.extend({}, record.getContext(), {bin_size: true}), }) .then(function (result) { if (result.length === 0) { @@ -3094,13 +3094,6 @@ var BasicModel = AbstractModel.extend({ // datapoint context is extended by fields widgets var context = _.extend({}, params.context); - if (params.fieldsInfo && params.viewType) { - _.each(params.fieldsInfo[params.viewType], function (field) { - if (field.context) { - _.extend(context, field.context); - } - }); - } var dataPoint = { _cache: type === 'list' ? {} : undefined, -- cgit v1.2.3