Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to inherit javascript method render i write this code for this method.?

By
ramoliya nikunj
on 5/30/16, 8:12 AM 319 views

openerp.crmn = function(instance) {

var instance = openerp;

var _t = instance.web._t,

_lt = instance.web._lt;

var QWeb = instance.web.qweb;

instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.ListView.List# */{

render: function () {

this.$current.empty().append(

QWeb.render('ListView.rows', _.extend({

render_cell: function () {

return self.render_cell.apply(self, arguments); }

}, this)));

this.pad_table_to(1);

consle.log("test")

},

});

};

0
Javi
On 8/31/16, 5:34 AM

To inherit existing class you have to use the .include statement. I think that your code could be like this (I didn't try it):

openerp.your_module_name = function(instance) {
"use strict";
var QWeb = instance.web.qweb;
var _t = instance.web._t;
var _lt = instance.web._lt;
instance.web.ListView.List.include(/** @lends instance.web.ListView.List# */{
render: function () {
this.$current.empty().append(
QWeb.render('ListView.rows', _.extend({
render_cell: function () {
return this.render_cell.apply(this, arguments); }
}, this)));
this.pad_table_to(1);
console.log("test")
},
});
};

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/30/16, 8:12 AM
Seen: 319 times
Last updated: 8/31/16, 5:34 AM