diff --git a/static/src/css/style.css b/static/src/css/style.css index 5bb54aa..1ccf67b 100644 --- a/static/src/css/style.css +++ b/static/src/css/style.css @@ -65,6 +65,10 @@ } .logo-scan{ + width: 250px; +} + +.pos-confirm-screen .logo-scan{ width: 150px; } @@ -125,6 +129,7 @@ } .pos .confirmation-screen .btn-back{ + margin: 20px; width: 300px; } @@ -305,7 +310,8 @@ h1.product-name { font-family: Inconsolata; text-shadow: 0px 2px 0px #d2d2d2; box-shadow: 0px 2px 0px #e1e1e1 inset; - width: 100%; + width: 220px; + /*width: 100%;*/ font-weight: normal; } @@ -357,6 +363,7 @@ h1.product-name { } .pos-confirm-screen { + margin-top: -80px; display: flex; align-items: center; justify-content: center; diff --git a/static/src/img/logo-scan.png b/static/src/img/logo-scan.png index 4fe7f48..df8e43e 100644 Binary files a/static/src/img/logo-scan.png and b/static/src/img/logo-scan.png differ diff --git a/static/src/js/container.js b/static/src/js/container.js index 6672e16..467d679 100644 --- a/static/src/js/container.js +++ b/static/src/js/container.js @@ -378,11 +378,22 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) var scale_screen = this.gui.screen_instances['balancescale']; this.set_weight(0); + // this.set_price(0); scale_screen.renderElement(); + queue.schedule(function () { + return self.pos.proxy.reset_weight().then(function () { + self.set_weight(0); + // self.set_price(0); + }); + }, {duration: 500}); + queue.schedule(function(){ - return self.pos.proxy.scale_read().then(function(weight){ - self.set_weight(weight.weight); + return self.pos.proxy.scale_read().then(function(scale_answer){ + self.set_weight(scale_answer.weight); + if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) { + self.set_weight(0); + } }); },{duration:500, repeat: true}); @@ -393,16 +404,13 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) var scale_screen = this.gui.screen_instances['balancescale']; scale_screen.weight = weight; scale_screen.$('.weight').text(scale_screen.get_product_weight_string()); + scale_screen.$('.computed-price').text(scale_screen.format_currency(scale_screen.get_product_price() * 0)); }, set_price: function (price) { var scale_screen = this.gui.screen_instances['balancescale']; - if (!price) { - scale_screen.$('.computed-price').text(scale_screen.get_computed_price_string()); - } else { - scale_screen.price = price; - scale_screen.$('.computed-price').text(scale_screen.format_currency(price)); - } + scale_screen.price = price; + scale_screen.$('.computed-price').text(scale_screen.format_currency(0)); }, barcode_container_action: function(code){ @@ -707,7 +715,7 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) scale_screen.weight = weight; scale_screen.weight_brut = container.weight + scale_screen.weight; scale_screen.$('.weight').text(scale_screen.get_product_weight_string()); - scale_screen.$('.computed-price').text(scale_screen.get_computed_price_string()); + scale_screen.$('.computed-price').text(scale_screen.format_currency(scale_screen.get_product_price() * 0)); scale_screen.$('.weight-brut').text(scale_screen.get_product_weight_string_brut()); if (container){ @@ -720,7 +728,11 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) }, click_product: function(product) { - this.create_transaction(product); + var scale_screen = this.gui.screen_instances['balancescale']; + + if (scale_screen.weight != 0) { + this.create_transaction(product); + } }, create_transaction: function(product){ diff --git a/static/src/xml/pos.xml b/static/src/xml/pos.xml index a742b97..fcf3e95 100644 --- a/static/src/xml/pos.xml +++ b/static/src/xml/pos.xml @@ -24,7 +24,6 @@
  • 1. Scanner l'étiquette
  • 2
  • 3
  • -
  • 4
  • @@ -195,8 +194,7 @@ @@ -208,6 +206,11 @@
    +

    +
    + à +
    +
    Nouvelle pesée @@ -293,7 +296,6 @@
  • 1
  • 2. Sélectionner un produit
  • 3
  • -
  • 4