Browse Source

Recap sur la pesée screen confirmation

12.0
Juliana 4 years ago
parent
commit
81dfacea95
  1. 1
      static/src/css/style.css
  2. 49
      static/src/js/container.js
  3. 31
      static/src/xml/pos.xml

1
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;

49
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);
// },
// });
},
});

31
static/src/xml/pos.xml

@ -110,24 +110,6 @@
</div>
</div>
</div>
<!-- <div class="screen-content">
<div class="top-content">
<span class='button back'>
<i class='fa fa-angle-double-left'></i>
Retour
</span>
<h1 class='product-name'>Ajouter un contenant</h1>
</div>
<div class="centered-content">
<div class='weight js-weight'>
<t t-esc="widget.get_product_weight_string()" />
</div>
<div class='add-container'>
Sauvegarder
<i class='fa fa-angle-double-right'></i>
</div>
</div>
</div> -->
</div>
</t>
@ -225,9 +207,9 @@
<img class="logo-scan mb-3" src="/vracoop_pos_free_balance_V2/static/src/img/picto-confirm.png" />
</div>
<h1 class='product-name'><t t-esc="widget.get_product_name()" /></h1>
<!-- <div class='product-price'>
<div class='product-price'>
à <t t-esc="widget.format_currency(widget.get_product_price()) + '/' + widget.get_product_uom()" />
</div> -->
</div>
</div>
</div>
</div>
@ -316,14 +298,5 @@
</div>
</div>
</t>
<!-- <t t-jquery='.layout-table' t-operation='before'>
<div class="top-content">
<span class='button back'>
<i class='fa fa-angle-double-left'></i>
Retour
</span>
</div>
</t> -->
<!-- <div class="rightpane"> -->
</t>
</templates>
Loading…
Cancel
Save