Bhumi Thakkar (Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-576121-bth 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-576121-bth/+merge/112496
Hello,
web client makes multiple reads when clicking a button to perform
action.Order of requests is not proper.
1. Sales => Sales => Sales Orders
2. Open any record and click on any button for example compute.
Observed: 'Main record is going to be saved of current model ('sale.order')
then related models ('sale.order.line') records are going to be saved and then
action is going to perform.'
Expected: 'First Action should perform then records of current model and
related model should save.'
Order of request is changed on execute action. First call function of action
perform and the recursive_save function and reload.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576121-bth/+merge/112496
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-576121-bth.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-06-25 07:20:46 +0000
+++ addons/web/static/src/js/view_form.js 2012-06-28 06:20:33 +0000
@@ -1298,30 +1298,29 @@
});
return def.promise();
} else {
- return self.on_confirmed();
+ return self.on_confirmed().then( function() {
+ self.view.recursive_save().pipe( function() { self.view.reload() });
+ });
}
};
if (!this.node.attrs.special) {
this.view.force_dirty = true;
- return this.view.recursive_save().pipe(exec_action);
- } else {
- return exec_action();
+ if (!this.view.datarecord.id) {
+ return this.view.recursive_save().pipe(exec_action);
+ }
}
+ return exec_action();
},
on_confirmed: function() {
var self = this;
-
var context = this.node.attrs.context;
if (context && context.__ref) {
context = new openerp.web.CompoundContext(context);
context.set_eval_context(this._build_eval_context());
}
-
return this.view.do_execute_action(
_.extend({}, this.node.attrs, {context: context}),
- this.view.dataset, this.view.datarecord.id, function () {
- self.view.reload();
- });
+ this.view.dataset, this.view.datarecord.id, function () {});
},
update_dom: function() {
this._super.apply(this, arguments);
_______________________________________________
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