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 @@