Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to calls my_method() in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 149
    Comment on it

    In below example a sample widget that calls my_method() and displays the result.

    local.HomePage = instance.Widget.extend({
        start: function() {
            var self = this;
            var model = new instance.web.Model("oepetstore.message_of_the_day");
            model.call("my_method", {context: new instance.web.CompoundContext()}).then(function(result) {
                self.$el.append("
    Hello " + result["hello"] + "
    "); // will show "Hello world" to the user }); }, });

    Note-The class used to call Odoo models is openerp.Model(). It is instantiated with the Odoo model's name as first parameter.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: