Browse Source

fixup! [MIG] pos_tare: Migration to 12.0

pull/501/head
Sylvain LE GAL 5 years ago
committed by François Kawala
parent
commit
f0ae549bf4
  1. 3
      pos_tare/__manifest__.py
  2. 8
      pos_tare/static/src/css/pos_tare.css
  3. 9
      pos_tare/static/src/js/screens.js
  4. 6
      pos_tare/static/src/xml/pos_tare.xml

3
pos_tare/__manifest__.py

@ -10,10 +10,11 @@
"author": "GRAP, "
"Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
"website": "https://www.github.com/pos",
"website": "https://www.github.com/OCA/pos",
"license": "AGPL-3",
"depends": ["point_of_sale"],
"data": ["views/assets.xml"],
"qweb": ["static/src/xml/pos_tare.xml"],
"installable": True,
"images": ["static/description/pos_tare.png"],
}

8
pos_tare/static/src/css/pos_tare.css

@ -21,19 +21,19 @@
margin-bottom: 0px;
}
.pos .scale-screen .weight-value-gross-weight {
.pos .scale-screen .weight-value-fixed {
border-radius: 3px;
box-shadow: 0px 2px 0px rgb(225,225,225) inset;
text-align: right;
background: white;
}
.pos .scale-screen .weight-value-tare {
.pos .scale-screen .weight-value-alterable {
text-align: left;
padding-bottom: 0px;
padding-left: 0px;
}
.pos .scale-screen .input-weight-tare {
.pos .scale-screen .input-weight {
border: 1px solid #cecbcb;
border-radius: 20px;
padding: 15px 20px;
@ -43,7 +43,7 @@
font-size: 25px;
}
.pos .scale-screen .input-weight-tare:focus {
.pos .scale-screen .input-weight:focus {
outline: none;
box-shadow: 0px 0px 0px 3px #6EC89B;
}

9
pos_tare/static/src/js/screens.js

@ -24,9 +24,8 @@ odoo.define('pos_tare.screens', function (require) {
show: function(){
this._super();
this.tare = 0.0;
this.correct_value = true;
var self = this;
this.$('#weight_tare').keyup(function(event){
this.$('#input_weight_tare').keyup(function(event){
self.onchange_tare(event);
});
},
@ -38,7 +37,7 @@ odoo.define('pos_tare.screens', function (require) {
set_weight: function(gross_weight){
this.gross_weight = gross_weight;
var net_weight = gross_weight - (this.tare || 0);
this.$('.weight-value-gross-weight').text(this.get_product_gross_weight_string());
this.$('#container_weight_gross').text(this.get_product_gross_weight_string());
this._super(net_weight);
},
@ -76,7 +75,7 @@ odoo.define('pos_tare.screens', function (require) {
},
onchange_tare: function(event){
this.tare = this.check_sanitize_value('#weight_tare');;
this.tare = this.check_sanitize_value('#input_weight_tare');;
this.set_weight(this.gross_weight);
},
@ -88,7 +87,7 @@ odoo.define('pos_tare.screens', function (require) {
}
else{
this.$(input_name).css("background-color", "#FFF");
return res;
return parseFloat(res, 10);
}
},

6
pos_tare/static/src/xml/pos_tare.xml

@ -11,12 +11,12 @@ Copyright (C) 2015-Today GRAP (http://www.grap.coop)
<div class="weight-label">
Gross Weight
</div>
<div class="weight-value weight-value-gross-weight" />
<div class="weight-value weight-value-fixed" id="container_weight_gross"/>
<div class="weight-label">
Tare
</div>
<div class="weight-value weight-value-tare">
<input type="text" class="input-weight-tare" id="weight_tare" name="weight_tare" placeholder="0.000"/> Kg
<div class="weight-value weight-value-alterable">
<input type="text" class="input-weight" id="input_weight_tare" placeholder="0.000"/> Kg
</div>
</t>
</t>

Loading…
Cancel
Save