diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 2964ad75991..5835f1e35e1 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -751,6 +751,10 @@ openerp.point_of_sale = function(db) { function CategoryView() { CategoryView.__super__.constructor.apply(this, arguments); } + + CategoryView.prototype.events = { + 'click .oe-pos-categories-list a': 'changeCategory' + }; CategoryView.prototype.template = qweb_template('pos-category-template'); CategoryView.prototype.render = function(ancestors, children) { @@ -776,6 +780,10 @@ openerp.point_of_sale = function(db) { })() })); }; + CategoryView.prototype.changeCategory = function(a) { + var id = $(a.target).data("category-id"); + this.trigger("changeCategory", id); + }; return CategoryView; })(); ProductView = (function() { @@ -1153,6 +1161,7 @@ openerp.point_of_sale = function(db) { } c = pos.categories[id]; $('#products-screen').html(this.categoryView.render(c.ancestors, c.children)); + this.categoryView.delegateEvents(); products = pos.store.get('product.product').filter( function(p) { var _ref; return _ref = p.pos_categ_id[0], __indexOf.call(c.subtree, _ref) >= 0; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d4962a62084..b9148395cbe 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -143,15 +143,15 @@