summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/services/data_manager.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-08-28 16:14:31 +0200
committerAaron Bohy <aab@odoo.com>2017-08-29 10:38:36 +0200
commitd93726f9ac6d64a39cd95f35cf61a898e4cd2009 (patch)
treeecba41a9f85a4368f3675f9710a9cf893c151ea0 /addons/web/static/src/js/services/data_manager.js
parentf24c83efcc47b24ac8fc7a8add8d2ce39a89ebdf (diff)
[FIX] web,mail: only send fields in view for onchanges
The field 'display_name' is automatically added to the list of fields to fetch when fetching a record. Before this rev., its value was also sent alongside the fields in the view for onchange RPCs. It shouldn't: only the fields in the view should be sent. It produced a weird bug in the res.partner form view: open a contact (company), add a sub-contact, save -> the display_name of the contact was then '' (and 'Contacts' was displayed in the breadcrumbs instead of the display_name of the opened contact). This is because 'display_name' was sent to the onchange, which returned '' as value (because of another bug python side). So as it's value changed, when saving, the new display_name was sent to the server (even if this field was actually readonly). Before this rev., we also always fetched 'display_name' when fetching list of records (read or search_read). This wasn't a bug per se, but it might be a computed field, and it isn't necessary, so we stop fetching it in that case if it isn't in the view (as it was done in saas-15, before the new views).
Diffstat (limited to 'addons/web/static/src/js/services/data_manager.js')
-rw-r--r--addons/web/static/src/js/services/data_manager.js5
1 files changed, 0 insertions, 5 deletions
diff --git a/addons/web/static/src/js/services/data_manager.js b/addons/web/static/src/js/services/data_manager.js
index 999a9d8df01..77857ef2d31 100644
--- a/addons/web/static/src/js/services/data_manager.js
+++ b/addons/web/static/src/js/services/data_manager.js
@@ -398,11 +398,6 @@ return core.Class.extend({
*/
_processFieldsView: function (viewInfo) {
var viewFields = this._processFields(viewInfo.type, viewInfo.arch, viewInfo.fields);
- // by default fetch display_name and id
- if (!viewInfo.fields.display_name) {
- viewInfo.fields.display_name = {type: 'char'};
- viewFields.display_name = {};
- }
viewInfo.fieldsInfo = {};
viewInfo.fieldsInfo[viewInfo.type] = viewFields;
utils.deepFreeze(viewInfo.fields);