Thursday 13 August 2015

Call method on Button "Save & Close" in odoo

Call method on Button "Save & Close" in odoo


Add Js in module and do like this.

In js file:


openerp.module_name = function(instance) {

var QWeb = openerp.web.qweb;
    _t = instance.web._t;

instance.web.FormView.include({
    load_form: function(data) {
        var self = this;
        this.$el.find('.oe_abstractformpopup-form-save').click(this.on_button_save);
        return self._super(data);
    },
    on_button_save: function() {
        this.dataset.index = null;
        this.do_show();
        console.log('Save & Close button method call...');
    },
});
};

No comments:

Post a Comment