From 81dfacea956918dea6b6eecbed66fb0241cc5faf Mon Sep 17 00:00:00 2001 From: Juliana Date: Thu, 16 Jul 2020 12:23:00 +0200 Subject: [PATCH] =?UTF-8?q?Recap=20sur=20la=20pes=C3=A9e=20screen=20confir?= =?UTF-8?q?mation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/src/css/style.css | 1 + static/src/js/container.js | 49 ++++++++++++++++++++++---------------- static/src/xml/pos.xml | 31 ++---------------------- 3 files changed, 31 insertions(+), 50 deletions(-) diff --git a/static/src/css/style.css b/static/src/css/style.css index cee502e..443b97e 100644 --- a/static/src/css/style.css +++ b/static/src/css/style.css @@ -207,6 +207,7 @@ h1.product-name { font-weight: normal; } +.pos .confirmation-screen .product-price, .pos .balancecontainerscale-screen .product-price, .pos .scale-screen .product-price { font-size: 25px; diff --git a/static/src/js/container.js b/static/src/js/container.js index 398ed65..89fcfc2 100644 --- a/static/src/js/container.js +++ b/static/src/js/container.js @@ -116,24 +116,39 @@ odoo.define('vracoop_pos_free_balance_V2.container_balance', function (require) $("#pos-topheader-scale").addClass('oe_hidden'); }, + _get_active_pricelist: function(){ + var current_order = this.pos.get_order(); + var current_pricelist = this.pos.default_pricelist; + + if (current_order) { + current_pricelist = current_order.pricelist; + } + + return current_pricelist; + }, + get_product_name: function(){ var product = this.gui.get_current_screen_param('product'); - + return (product ? product.display_name : undefined) || 'Unnamed Product'; }, - // get_product_price: function(){ - // var product = this.gui.get_current_screen_param('product'); - // return (product ? product.get_price(pricelist, 2) : 0) || 0; - // }, - // get_product_uom: function(){ - // var product = this.gui.get_current_screen_param('product'); - // if(product){ - // return this.pos.units_by_id[product.uom_id[0]].name; - // }else{ - // return ''; - // } - // }, + get_product_price: function(){ + var product = this.gui.get_current_screen_param('product'); + var pricelist = this._get_active_pricelist(); + console.log(pricelist); + return (product ? product.get_price(pricelist, 1) : 0) || 0; + }, + + get_product_uom: function(){ + var product = this.gui.get_current_screen_param('product'); + + if(product){ + return this.pos.units_by_id[product.uom_id[0]].name; + }else{ + return ''; + } + }, }); @@ -545,14 +560,6 @@ odoo.define('vracoop_pos_free_balance_V2.container_balance', function (require) var product = this.get_product(); console.log(product); this.gui.show_screen('confirmation',{product: product}); - // self.gui.show_screen(self.next_screen); - // self.gui.show_popup('confirm-pesee',{ - // 'title': _t('Merci'), - // 'body': _t('La pesée est validée'), - // confirm: function(){ - // self.gui.show_screen(self.next_screen); - // }, - // }); }, }); diff --git a/static/src/xml/pos.xml b/static/src/xml/pos.xml index 655e202..1acbf4f 100644 --- a/static/src/xml/pos.xml +++ b/static/src/xml/pos.xml @@ -110,24 +110,6 @@ - @@ -225,9 +207,9 @@

- + @@ -316,14 +298,5 @@ - -