From 38aa984f31f525539d27f2bf47806352705830ba Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 9 Jan 2015 18:02:48 +0100 Subject: [FIX] web: avoid rendering fields on one2many list validation This rev. reverts 91911159f5bc12046d791744ff23562378be047f The above rev. was a good idea, except that internal_set_value expects the raw value, while the records attributes can be tuples(for instance, many2one are tuple(id, name) or list of command(one2many, many2many). set_value must be use here, as all fields (js) override set_value in order to handle their value repr (for instance, many2one fields handle the tuple (id,name). Besides, avoiding the re-render provides a huge performance improvment, as rerendering fields can lead to xmlrpc calls (for instance, re-rendering a many2one field implies calling the name_get method) opw-620111 opw-622108 --- addons/web/static/src/js/view_list_editable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/view_list_editable.js') diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 8cb34418bdb..1fa3c0831b5 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -228,8 +228,9 @@ openerp.web.list_editable = function (instance) { this.records.add(record, { at: this.prepends_on_create() ? 0 : null}); } - - return this.ensure_saved().then(function () { + return this.ensure_saved().then(function(){ + return $.when.apply(null, self.editor.form.render_value_defs); + }).then(function () { var $recordRow = self.groups.get_row_for(record); var cells = self.get_cells_for($recordRow); var fields = {}; -- cgit v1.2.3