From 221dcfc0741791aea66b3f6d4432ac884454591e Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 3 Jan 2012 11:07:53 +0100 Subject: [PATCH 1/4] [imp] improvements of order tabs bzr revid: nicolas.vanhoren@openerp.com-20120103100753-pvyxqxectytez73y --- addons/point_of_sale/static/src/css/pos.css | 3 +-- addons/point_of_sale/static/src/js/pos.js | 10 ++++++++-- addons/point_of_sale/static/src/xml/pos.xml | 3 +-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 3db419eb453..b25158a2576 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -125,8 +125,7 @@ } .point-of-sale #neworder-button { width: 32px; - padding: 1px; - font-size: 23px; + padding: 4px 10px; } .point-of-sale #loggedas { float: right; diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 232992e6740..d209a64709f 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -364,6 +364,7 @@ openerp.point_of_sale = function(db) { step: 'products', }; Order.prototype.initialize = function() { + this.set({creationDate: new Date}); this.set({ orderLines: new OrderlineCollection }); @@ -742,7 +743,12 @@ openerp.point_of_sale = function(db) { setValue: function(val) { var param = {}; param[this.numpadState.get('mode')] = val; - this.shop.get('selectedOrder').selected.set(param); + var order = this.shop.get('selectedOrder'); + if (order.get('orderLines').length !== 0) { + order.selected.set(param); + } else { + this.shop.get('selectedOrder').destroy(); + } }, changeSelectedOrder: function() { this.currentOrderLines.unbind(); @@ -1077,7 +1083,7 @@ openerp.point_of_sale = function(db) { this.order.destroy(); }, render_element: function() { - this.$element.html(this.template_fct(this.order.toJSON())); + this.$element.html(this.template_fct({widget:this})); this.$element.addClass('order-selector-button'); } }); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 95091a3059b..fd41b2c1bf8 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -231,8 +231,7 @@
- - +