Chirag Patel (OpenERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-576370-cpa into lp:openerp-web/6.1.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #1018508 in OpenERP Web: "Wrong ID passed to the function corresponding
to the button"
https://bugs.launchpad.net/openerp-web/+bug/1018508
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576370-cpa/+merge/114604
Hello,
O2m form button action reload form but dataset index not set properly.
To reproduce :
Related bugs : #1018508
In reset_ids pass blank list and set_ids() set dataset index null when no ids.
When dataset index null then set_value() set 0.
So click on button and reload page but index not set for current id of o2m form.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576370-cpa/+merge/114604
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-576370-cpa.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-06-29 15:28:11 +0000
+++ addons/web/static/src/js/view_form.js 2012-07-12 10:32:19 +0000
@@ -2515,9 +2515,9 @@
set_value: function(value) {
value = value || [];
var self = this;
- this.dataset.reset_ids([]);
if(value.length >= 1 && value[0] instanceof Array) {
var ids = [];
+ this.dataset.reset_ids([]);
_.each(value, function(command) {
var obj = {values: command[2]};
switch (command[0]) {
@@ -2549,6 +2549,7 @@
this.dataset.set_ids(ids);
} else if (value.length >= 1 && typeof(value[0]) === "object") {
var ids = [];
+ this.dataset.reset_ids([]);
this.dataset.delete_all = true;
_.each(value, function(command) {
var obj = {values: command};
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp