From f2c8f6d970988c3a15d0abb8fb38083f2bea74ba Mon Sep 17 00:00:00 2001 From: Vishmita Date: Wed, 28 Nov 2012 11:59:26 +0530 Subject: [PATCH] [FIX]when there is no product into the POS category it gives an error. bzr revid: vja@tinyerp.com-20121128062926-qjweapwl8o3l94op --- addons/point_of_sale/static/src/js/db.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index f8ae9cdb56d..0df57759156 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -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; },