summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/services/data_manager.js
diff options
context:
space:
mode:
authorAlexandre Kühn <alex.e.kuhn@gmail.com>2018-01-09 12:04:21 +0100
committerAlexandre Kühn <alexkuhn@users.noreply.github.com>2018-01-12 16:12:49 +0100
commit41fe7f9d1113d026b226b136b4477aaaf9f1f638 (patch)
treebcaf1204fdcc6a54fc497c23b1ec227d414cddfd /addons/web/static/src/js/services/data_manager.js
parent7813a8e714f268983b0be88827ae1c8ad887e6c7 (diff)
[FIX] web: contexts on field widgets + enforce bin_size for binary
Field widgets now have a key 'context' that let them extend the context of the dataPoint (e.g. list). In particular, widgets on binary fields enforce the contextual item {bin_size: True}, so that the server gives the size of the binary field as its value, instead of its content. This change on binary fields reduces network load when accessing a view with binary fields.
Diffstat (limited to 'addons/web/static/src/js/services/data_manager.js')
-rw-r--r--addons/web/static/src/js/services/data_manager.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web/static/src/js/services/data_manager.js b/addons/web/static/src/js/services/data_manager.js
index 9b11f3a54a7..6e39ede94e8 100644
--- a/addons/web/static/src/js/services/data_manager.js
+++ b/addons/web/static/src/js/services/data_manager.js
@@ -387,6 +387,10 @@ return core.Class.extend({
attrs.fieldDependencies = attrs.Widget.prototype.fieldDependencies;
}
+ if (attrs.Widget.prototype.context) {
+ attrs.context = attrs.Widget.prototype.context;
+ }
+
return attrs;
},
/**