[FIX]when there is no product into the POS category it gives an error.

bzr revid: vja@tinyerp.com-20121128062926-qjweapwl8o3l94op
This commit is contained in:
Vishmita 2012-11-28 11:59:26 +05:30
parent 09eccd07dc
commit f2c8f6d970
1 changed files with 4 additions and 2 deletions

View File

@ -213,8 +213,10 @@ function openerp_pos_db(instance, module){
var stored_products = this.load('products',{});
var product_ids = stored_categories[category_id];
var list = [];
for(var i = 0, len = Math.min(product_ids.length,this.limit); i < len; i++){
list.push(stored_products[product_ids[i]]);
if (product_ids) {
for (var i = 0, len = Math.min(product_ids.length, this.limit); i < len; i++) {
list.push(stored_products[product_ids[i]]);
}
}
return list;
},