Odoo Help


How to make changes in existing search parameters in point of sale Js files in openerp 7.0 ?

on 5/4/13, 8:23 AM 2,600 views

I am new to Openerp 7.0 and finding it difficult to add an extra search parameter in the js file in the point of sale module.

Sreedath Namangalam
On 8/2/13, 4:53 AM

In db.js, modify the _product_search_string function as you need. For example, if you want to add searching for default_code also, then the function can be written as,

_product_search_string: function(product){
            var str = '' + product.id + ':' + product.name;
                str += '|' + product.ean13;
                str += '|' + product.default_code;
            var packagings = this.packagings_by_product_id[product.id] || [];
            for(var i = 0; i < packagings.length; i++){
                str += '|' + packagings[i].ean;
            return str + '\n';

And in the models.js file, in the function load_server_data, in the delf.fetch part of product.product, add the field default_code.

 return self.fetch(
   fields=['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code',
   'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
  {pricelist: self.get('shop').pricelist_id[0]} // context for price

The example above doesn't do anything for me.

on 8/4/13, 6:56 AM

I have updated my answer

Sreedath Namangalam
on 8/5/13, 2:44 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/4/13, 8:23 AM
Seen: 2600 times
Last updated: 3/16/15, 8:10 AM