[IMP] point_of_sale: make products searchable by internal reference (default_code)

bzr revid: fva@openerp.com-20130912141208-8xrxaf96j5jn5z9u
This commit is contained in:
Frédéric van der Essen 2013-09-12 16:12:08 +02:00
parent 1d91378ce2
commit c82bbdbb91
2 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,9 @@ function openerp_pos_db(instance, module){
if(product.ean13){
str += '|' + product.ean13;
}
if(product.default_code){
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;

View File

@ -170,7 +170,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return self.fetch(
'product.product',
['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13',
['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'],
[['sale_ok','=',true],['available_in_pos','=',true]],
{pricelist: self.get('shop').pricelist_id[0]} // context for price