I need to override a method from POS javascript file(db.js) search_product_in_category. I tried it using following code but no luck.
function pos_advance_search(instance, module){
var PosDBSuper = module.PosDB
module.PosDB = module.PosDB.include({
load_server_data: function(){
var self = this;
var loaded = PosDBSuper.prototype.load_server_data.call(this);
return loaded;
},
search_product_in_category: function(category_id, query){
res=[]
// some code goes here....
return res;
},
});
},
(function(){
var _super = window.openerp.point_of_sale;
window.openerp.point_of_sale = function(instance){
_super(instance);
var module = instance.point_of_sale;
pos_advance_search(instance, module);
}
})()