Skip to Content
Menu
This question has been flagged
1 Reply
4175 Views

I am doing some point of sale customization however i am not sure how to inherit to the point of sale js file  (odoo 11)

i want to inherit modes.js 'product.product' loaded function

{

model: 'product.product',

// todo remove list_price in master, it is unused

fields: ['display_name', 'list_price', 'lst_price', 'standard_price', 'categ_id', 'pos_categ_id', 'taxes_id',

'barcode', 'default_code', 'to_weight', 'uom_id', 'description_sale', 'description',

'product_tmpl_id','tracking'],

order: _.map(['sequence','default_code','name'], function (name) { return {name: name}; }),

domain: [['sale_ok','=',true],['available_in_pos','=',true]],

context: function(self){ return { display_default_code: false }; },

loaded: function(self, products){

// i want to add some codes here //

self.db.add_products(_.map(products, function (product) {

product.categ = _.findWhere(self.product_categories, {'id': product.categ_id[0]});

return new exports.Product({}, product);

}));

},

Avatar
Discard
Best Answer

Hello,

Please check below link:-

https://www.odoo.com/forum/help-1/question/inheritance-of-posmodel-in-pos-models-js-file-59023

Thanks

Avatar
Discard