If you use to initializer receives the parameters passed when using the new operator in OpenERP(Odoo) follow the below mentioned code and paste it in your .js file.
var MyClass = instance.web.Class.extend({
init: function(name) {
this.name = name;
},
say_hello: function() {
console.log("hello", this.name);
},
});
var my_object = new MyClass("Bob");
my_object.say_hello();
Note-It is also possible to create subclasses from existing classes by calling extend() on the parent class, as is done to subclass Class().
0 Comment(s)