Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh into
lp:openerp-web/6.1.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh/+merge/118309
Hello,
Fixed the issue of button click which is inside one2many list, here when
workflow buttons are clicked record is not reloaded from the database, hence
buttons are not shown properly based on workflow state.
Demo -: Manufacturing -> Manufacturing Order -> Edit any record which is in
"ready to produce" state, activate workorder tab, click on start, pause or
finish button record is not reloaded.
Reason :- The is faced only in one2many list view because when record is
reloaded it will read the record from the cache, hence it will load the same
record, instead the record should be read from the database, hence removed the
cache record object so that the id in read_ids can set into to_get list and
goes to read from the database.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh/+merge/118309
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-07-20 12:48:22 +0000
+++ addons/web/static/src/js/view_form.js 2012-08-06 07:05:45 +0000
@@ -2805,10 +2805,13 @@
});
},
do_button_action: function (name, id, callback) {
+ var self = this;
var _super = _.bind(this._super, this);
this.o2m.view.do_save().then(function () {
_super(name, id, callback);
+ var cached = _.detect(self.dataset.cache, function(x) {return x.id === id; });
+ self.dataset.cache.pop(cached);
});
}
});
_______________________________________________
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