Skip to Content
Menu
This question has been flagged
3559 Views

Hello:


I have a time consuming server method that needs to be run asynchronously so user can keep working on something else while method is running on the backend.

Currently I am doing it thru a cron job, but now I need to call the method per user request thru a form button.


I tried JS RPC high-level API thru XML button; py method is run but still UI gets held upon method completion.

This is the JS I am running.


Thanks!


Mayte

openerp.my_addon = function (instance,action) {

instance.web.client_actions.add('my.addon.validate.action', 'instance.my_addon.validate_action');

instance.my_addon.validate_action = function (parent, action) {

var active_id = action.context.active_id;


   var MyModel = new instance.web.Model('my.model');
MyModel.call("call_model_method", [[active_id]]);
return;
};
};

Avatar
Discard