From d3fc2b3602a1626b276cfd7cd2290d532164557e Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Tue, 22 Jan 2013 16:03:58 +0530 Subject: [FIX] onchange call after m2o returns after/with changes.--fixes:lp577376 bzr revid: bth@tinyerp.com-20130122103358-csduy0gtwi58kp76 --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 01d4bf6dd33..bea0bec5f80 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3034,6 +3034,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc self.display_value = {}; self.render_value(); self.focus(); + self.view.do_onchange(self); }); }); -- cgit v1.2.3 From 93a1d36d90f85312ca4bfc8ba8820c54fa5b274f Mon Sep 17 00:00:00 2001 From: Vishmita Date: Tue, 22 Jan 2013 19:09:56 +0530 Subject: [FIX]Pager doesn't disappear when we create a new record from o2m/m2m popup lp bug: https://launchpad.net/bugs/1096830 fixed bzr revid: vja@tinyerp.com-20130122133956-tv425if9oe3zqsr6 --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 01d4bf6dd33..376f5209d62 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4714,6 +4714,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend if (this.view_list) { this.view_list.$el.hide(); } + this.$el.find('.oe_popup_list_pager').hide(); this.setup_form_view(); }, }); -- cgit v1.2.3 From 6c460544cc70a9781bdd4d4414ef52c9361b3c14 Mon Sep 17 00:00:00 2001 From: Vishmita Date: Wed, 23 Jan 2013 16:28:38 +0530 Subject: [Fix]Improve code bzr revid: vja@tinyerp.com-20130123105838-kd4isg7vcxcfk0su --- addons/web/static/src/js/view_form.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 376f5209d62..3249507f4bb 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4712,9 +4712,8 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend this.searchview.hide(); } if (this.view_list) { - this.view_list.$el.hide(); + this.view_list.do_hide(); } - this.$el.find('.oe_popup_list_pager').hide(); this.setup_form_view(); }, }); -- cgit v1.2.3 From 0e664c9e93ba4c64cb31a8b8f0a2203750b7eb64 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (Open ERP)" Date: Fri, 29 Mar 2013 14:15:28 +0530 Subject: [FIX]Fix the issue of editing inline many2one values doesn't show up with field name legth bzr revid: dhr@tinyerp.com-20130329084528-a3ppzy7paww97yc7 --- addons/web/static/src/js/view_list.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 3c89ef7126e..33a4aa1c3cd 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -534,8 +534,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.records.remove(record); return; } - _(records[0]).each(function (value, key) { - record.set(key, value, {silent: true}); + var transfer_value = records[0]; + _(_.keys(transfer_value)).each(function(key){ + record.set(key, transfer_value[key], {silent: true}); }); record.trigger('change', record); }); -- cgit v1.2.3 From d8dd8fc14bda8e3888a1580b9e344754b862f558 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Thu, 9 May 2013 14:21:02 +0530 Subject: [FIX]Fixe the issue of listview record re-ordering which is not working due to revision 3898. bzr revid: msh@openerp.com-20130509085102-ln4lidp7caqw25ur --- addons/web/static/src/js/data.js | 3 +++ addons/web/static/src/js/view_list.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index d60f72c6577..96521c6a885 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -610,6 +610,9 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, remove_ids: function (ids) { this.alter_ids(_(this.ids).difference(ids)); }, + add_ids: function(ids) { + this.alter_ids(_(this.ids).union(ids)); + }, /** * Resequence records. * diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index b96079d2051..c39406a7e4a 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -896,7 +896,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. this.record_callbacks = { 'remove': function (event, record) { var id = record.get('id'); - self.dataset.remove_ids([id]) + self.dataset.remove_ids([id]); var $row = self.$current.children('[data-id=' + id + ']'); var index = $row.data('index'); $row.remove(); @@ -925,6 +925,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. }, 'add': function (ev, records, record, index) { var $new_row = $(self.render_record(record)); + var id = record.get('id'); + self.dataset.add_ids([id]); if (index === 0) { $new_row.prependTo(self.$current); -- cgit v1.2.3 From 431e0761c02a9f5591caa2b72ba02d1dd880b9eb Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 4 Jun 2013 17:05:51 +0200 Subject: [FIX] assertion errors in search view when selecting all of a search input's content Force normalization of the input's root node, Firefox tends to spawn multiple text node children then create selection ranges over all of them and worse. lp bug: https://launchpad.net/bugs/1169945 fixed bzr revid: xmo@openerp.com-20130604150551-0m0b48aifg9favz8 --- addons/web/static/src/js/search.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index e84a9472ff3..f0d211fd3b0 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -131,6 +131,7 @@ my.InputView = instance.web.Widget.extend({ paste: 'onPaste', }, getSelection: function () { + this.el.normalize(); // get Text node var root = this.el.childNodes[0]; if (!root || !root.textContent) { @@ -139,6 +140,16 @@ my.InputView = instance.web.Widget.extend({ return {start: 0, end: 0}; } var range = window.getSelection().getRangeAt(0); + // In Firefox, depending on the way text is selected (drag, double- or + // triple-click) the range may start or end on the parent of the + // selected text node‽ Check for this condition and fixup the range + // note: apparently with C-a this can go even higher? + if (range.startContainer === this.el && range.startOffset === 0) { + range.setStart(root, 0); + } + if (range.endContainer === this.el && range.endOffset === 1) { + range.setEnd(root, root.length) + } assert(range.startContainer === root, "selection should be in the input view"); assert(range.endContainer === root, @@ -149,6 +160,7 @@ my.InputView = instance.web.Widget.extend({ } }, onKeydown: function (e) { + this.el.normalize(); var sel; switch (e.which) { // Do not insert newline, but let it bubble so searchview can use it @@ -186,6 +198,7 @@ my.InputView = instance.web.Widget.extend({ } }, setCursorAtEnd: function () { + this.el.normalize(); var sel = window.getSelection(); sel.removeAllRanges(); var range = document.createRange(); @@ -196,13 +209,14 @@ my.InputView = instance.web.Widget.extend({ // from about half the link to half the text, paste in search box then // hit the left arrow key, getSelection would blow up). // - // Explicitly selecting only the inner text node (only child node at - // this point, though maybe we should assert that) avoiids the issue + // Explicitly selecting only the inner text node (only child node + // since we've normalized the parent) avoids the issue range.selectNode(this.el.childNodes[0]); range.collapse(false); sel.addRange(range); }, onPaste: function () { + this.el.normalize(); // In MSIE and Webkit, it is possible to get various representations of // the clipboard data at this point e.g. // window.clipboardData.getData('Text') and @@ -224,6 +238,7 @@ my.InputView = instance.web.Widget.extend({ var data = this.$el.text(); // paste raw text back in this.$el.empty().text(data); + this.el.normalize(); // Set the cursor at the end of the text, so the cursor is not lost // in some kind of error-spawning limbo. this.setCursorAtEnd(); -- cgit v1.2.3 From bdcb5531286ab84c8ad470fa0e068f0b70d663ff Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 5 Jun 2013 12:52:27 +0200 Subject: [FIX] MSIE9 issue where complete.previous would be '' instead of undefined bzr revid: xmo@openerp.com-20130605105227-6e5a6ckxshk8uwkg --- addons/web/static/src/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index f0d211fd3b0..9a111cf08ad 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -548,7 +548,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var val = this.$el.val(); this.$el.val(''); var complete = this.$el.data('autocomplete'); - if ((val && complete.term === undefined) || complete.previous !== undefined) { + if ((val && complete.term === undefined) || complete.previous) { throw new Error("new jquery.ui version altering implementation" + " details relied on"); } -- cgit v1.2.3 From d72773015e60be3ba0bbe1dd43997019611f2505 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 5 Jun 2013 16:49:49 +0200 Subject: [IMP] close search autocompletion list while completing Looks slightly worse as results don't seamlessly update in-place, but limits/avoids the risk of quick-typing, hitting [Return] and getting an incomplete/incorrect query because the completion didn't catch up (e.g. slow network) and [Return] validated the previously retrieved completion. lp bug: https://launchpad.net/bugs/1183746 fixed bzr revid: xmo@openerp.com-20130605144949-jbzs2hppr6c1djg3 --- addons/web/static/src/js/search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 9a111cf08ad..2097cd62434 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -471,11 +471,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var autocomplete = this.$el.autocomplete({ source: this.proxy('complete_global_search'), select: this.proxy('select_completion'), + search: function () { self.$el.autocomplete('close'); }, focus: function (e) { e.preventDefault(); }, html: true, autoFocus: true, minLength: 1, - delay: 0 + delay: 0, }).data('autocomplete'); // MonkeyPatch autocomplete instance -- cgit v1.2.3 From 7ad343636b98e894a599b1578d90f4d3007d69d9 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 6 Jun 2013 16:26:16 +0200 Subject: [FIX] view_list: when we have more than 80 record in list and we create new record and switch the views like form->list->form gives traceback. Get if the index is over the number of visible records bzr revid: chm@openerp.com-20130606142616-41xxepfzkdvyqu9m --- addons/web/static/src/js/view_list.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index b96079d2051..357e9beffab 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -503,12 +503,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi var reloaded = $.Deferred(); this.$el.find('.oe_list_content').append( this.groups.render(function () { - if (self.dataset.index == null) { - var has_one = false; - self.records.each(function () { has_one = true; }); - if (has_one) { + if (self.dataset.index == null && self.records.length || + self.dataset.index >= self.records.length) { self.dataset.index = 0; - } } self.compute_aggregates(); reloaded.resolve(); -- cgit v1.2.3 From 56e4be5d1d53291862cbb3cf1b7f3d94c5a46725 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Jun 2013 10:39:01 +0200 Subject: [IMP] Improve typos in warning (Grammar mistake, Capitalize title, Typos) bzr revid: chm@openerp.com-20130607083901-f24fjvo0vi696ll3 --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/view_form.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index de49b11645d..aa7c9630efe 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1328,7 +1328,7 @@ instance.web.WebClient = instance.web.Client.extend({ if (browser_offset !== user_offset) { var $icon = $(QWeb.render('WebClient.timezone_systray')); $icon.on('click', function() { - var notification = self.do_warn(_t("Timezone mismatch"), QWeb.render('WebClient.timezone_notification', { + var notification = self.do_warn(_t("Timezone Mismatch"), QWeb.render('WebClient.timezone_notification', { user_timezone: instance.session.user_context.tz || 'UTC', user_offset: user_offset, browser_offset: browser_offset, diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 480bd482a2b..cd6ed39b924 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2346,7 +2346,7 @@ instance.web.form.FieldEmail = instance.web.form.FieldChar.extend({ }, on_button_clicked: function() { if (!this.get('value') || !this.is_syntax_valid()) { - this.do_warn(_t("E-mail error"), _t("Can't send email to invalid e-mail address")); + this.do_warn(_t("E-mail Error"), _t("Can't send email to invalid e-mail address")); } else { location.href = 'mailto:' + this.get('value'); } @@ -2376,7 +2376,7 @@ instance.web.form.FieldUrl = instance.web.form.FieldChar.extend({ }, on_button_clicked: function() { if (!this.get('value')) { - this.do_warn(_t("Resource error"), _t("This resource is empty")); + this.do_warn(_t("Resource Error"), _t("This resource is empty")); } else { var url = $.trim(this.get('value')); if(/^www\./i.test(url)) @@ -5305,7 +5305,7 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie // TODO : activate send on wizard and form if (result.error || !result.id ) { - this.do_warn( _t('Uploading error'), result.error); + this.do_warn( _t('Uploading Error'), result.error); files = _.filter(files, function (val) { return !val.upload; }); } else { for(var i in files){ -- cgit v1.2.3 From a941c199c19279c6a2fd947dca3d1a80b9aa35c9 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Jun 2013 12:15:17 +0200 Subject: [FIX] translation button or icon not displayed with html widget. Bug 1179505 bzr revid: chm@openerp.com-20130607101517-zilu97d4akhho72v --- addons/web/static/src/js/view_form.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index cd6ed39b924..f242bf50cc9 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2721,6 +2721,11 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc self.internal_set_value(self.$textarea.val()); } }); + if (this.field.translate) { + var $img = $('') + .click(this.on_translate); + this.$cleditor.$toolbar.append($img); + } } }, render_value: function() { -- cgit v1.2.3 From 27db64f7a081baa5cc1a32248dc378a55dd8f006 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Jun 2013 15:22:03 +0200 Subject: [FIX] duplicate tag when press tab key two time. Bug 1154057 bzr revid: chm@openerp.com-20130607132203-rcvx6wu820o03tiu --- addons/web/static/src/js/view_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index f242bf50cc9..5a9c8695e53 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4108,7 +4108,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in ext: { autocomplete: { selectFromDropdown: function() { - $(this).trigger('hideDropdown'); + this.trigger('hideDropdown'); var index = Number(this.selectedSuggestionElement().children().children().data('index')); var data = self.search_result[index]; if (data.id) { @@ -4117,6 +4117,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in ignore_blur = true; data.action(); } + this.trigger('setSuggestions', {result : []}); }, }, tags: { -- cgit v1.2.3 From 1ea609ba651c070d1d90c3321a210a2346de17ea Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 7 Jun 2013 17:23:26 +0200 Subject: [FIX] bugs discovered by failing onwrite test case Following xmo@openerp.com-20130607120355-x3poxy2ar2bpqqvw: * add_ids should not add ids which are already in the dataset, this leads to duplicates which the web client does not overly like * methods which add or remove records should not manipulate dataset.ids as well as that's now automatic (on_write feature) * record add should only insert the id in the dataset on non-false ids (e.g. list edition uses "pending" record with false id during creation, then sets the id it got from create() call) bzr revid: xmo@openerp.com-20130607152326-2pja1kuwo0ropfuw --- addons/web/static/src/js/data.js | 2 +- addons/web/static/src/js/view_list.js | 9 ++------- addons/web/static/src/js/view_list_editable.js | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 5884336dcfe..679afe77bcd 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -626,7 +626,7 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, this.alter_ids(_(this.ids).difference(ids)); }, add_ids: function(ids, at) { - var args = [at, 0].concat(ids); + var args = [at, 0].concat(_.difference(ids, this.ids)); this.ids.splice.apply(this.ids, args); }, /** diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 60c3acad107..9d09316f618 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -906,12 +906,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. throw new Error(_.str.sprintf( _t("Setting 'id' attribute on existing record %s"), JSON.stringify(record.attributes) )); } - if (!_.contains(self.dataset.ids, value)) { - // add record to dataset if not already in (added by - // the form view?) - self.dataset.ids.splice( - self.records.indexOf(record), 0, value); - } + self.dataset.add_ids([value], self.records.indexOf(record)); // Set id on new record $row = self.$current.children('[data-id=false]'); } else { @@ -923,7 +918,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. 'add': function (ev, records, record, index) { var $new_row = $(self.render_record(record)); var id = record.get('id'); - self.dataset.add_ids([id], index); + if (id) { self.dataset.add_ids([id], index); } if (index === 0) { $new_row.prependTo(self.$current); diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 4e042b60c5d..512fc4ff373 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -429,7 +429,6 @@ openerp.web.list_editable = function (instance) { var index = this.records.indexOf(source_record) + 1; record = this.make_empty_record(id); this.records.add(record, {at: index}); - this.dataset.ids.splice(index, 0, id); } return this.reload_record(record); }, -- cgit v1.2.3 From ac63b66448ff8b0231fe951f560d8ee83db98b47 Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Fri, 7 Jun 2013 18:37:02 +0200 Subject: [ADD]web: chrome.js add My OpenERP.com account bzr revid: dle@openerp.com-20130607163702-4q2mr9y0cztxqflo --- addons/web/static/src/js/chrome.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index aa7c9630efe..16e24634058 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1134,6 +1134,25 @@ instance.web.UserMenu = instance.web.Widget.extend({ }); } }, + on_menu_account: function() { + var self = this; + if (!this.getParent().has_uncommitted_changes()) { + var P = new instance.web.Model('ir.config_parameter'); + P.call('get_param', ['database.uuid']).then(function(dbuuid) { + var state = { + 'd': instance.session.db, + 'u': window.location.protocol + '//' + window.location.host, + }; + var params = { + response_type: 'token', + client_id: dbuuid || '', + state: JSON.stringify(state), + scope: 'userinfo', + }; + instance.web.redirect('https://accounts.openerp.com/oauth2/auth?'+$.param(params)); + }); + } + }, on_menu_about: function() { var self = this; self.rpc("/web/webclient/version_info", {}).done(function(res) { -- cgit v1.2.3 From aa416a9951e57bb86c78df355c9441edf27dff5f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 10 Jun 2013 09:10:36 +0200 Subject: [IMP] use introduced variable across function bzr revid: xmo@openerp.com-20130610071036-8w771r4urq5j31zz --- addons/web/static/src/js/view_list.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 0f4225a54db..74c2fc47aee 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -527,13 +527,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi return r.tag === 'field'; }), 'name') ).done(function (records) { - if (!records[0]) { + var values = records[0]; + if (!values) { self.records.remove(record); return; } - var transfer_value = records[0]; - _(_.keys(transfer_value)).each(function(key){ - record.set(key, transfer_value[key], {silent: true}); + _(_.keys(values)).each(function(key){ + record.set(key, values[key], {silent: true}); }); record.trigger('change', record); }); -- cgit v1.2.3