İçereği Atla
Menü
Bu soru işaretlendi
5991 Görünümler

Openerp 7 Custom Module Form View show success message after creating new record. 

Based on the requirement core module below highlighted code is added. (The below code is working without any issue).

File: addons/web/static/js/view_form.js

    on_button_save: function() {
        var self = this;
        return this.save().done(function(result) {
            self.trigger("save", result);
            /* The Below code is added for Cusom Module */
            if (self.model=='Module Name')
            {
              self.do_notify("Emp", "Record ID " + result + " Successfully Created");
             }
            /* End */

            self.to_view_mode();
        }).then(function(result) {
            var parent = self.ViewManager.ActionManager.getParent();
            if(parent){
                parent.menu.do_reload_needaction();
            }
        });
    },

The above code how to inherit in Custom Module custom_module/static/src/js/custom.js. I tried instance.web.FormView inherit with extend and include keyword but failed to get output.  please guide me the same.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Oca 25
486
1
Mar 21
7324
0
Tem 25
253
0
Haz 25
470
1
Haz 25
1018