Browse Source

Ajout coche Est comptoir, change fonctionnement container

12.0
Juliana 4 years ago
parent
commit
816235bcde
  1. 1
      models/pos_config.py
  2. 4
      static/src/css/style.css
  3. 24
      static/src/js/container.js
  4. 6
      static/src/js/models_and_db.js
  5. 4
      views/pos_config_views.xml

1
models/pos_config.py

@ -17,6 +17,7 @@ class PosConfig(models.Model):
balance_id = fields.Char("Identifiant de la balance")
logo_path = fields.Char(
"URL Logo", compute="_compute_image_path")
is_comptoir = fields.Boolean("Est une balance comptoir")
def _compute_image_path(self):
for pos in self:

4
static/src/css/style.css

@ -380,10 +380,10 @@ h1.product-name {
.pos-bottom.pos-bottom-confirm{
height: 100%;
}
/*
.searchbox{
display: none;
}
}*/
.pos .product-list-scroller{
padding-bottom: 200px;

24
static/src/js/container.js

@ -313,7 +313,9 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
self.set_weight(scale_answer.weight);
if ((scale_answer.error === '30' || scale_answer.error === '31') && scale_answer.weight !== 0) {
self.gui.show_screen(self.next_screen);
self.create_container();
if (this.pos.config.is_comptoir) {
self.create_container();
}
}
});
}, {duration: 500, repeat: true});
@ -367,15 +369,21 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require)
selected_order.add_container(container);
self.gui.show_popup('confirm-pesee',{
'title': _t('Merci'),
'body': _t('Contenant ajouté, vous pouvez vous servir'),
confirm: function(){
self.gui.show_screen(self.next_screen);
},
});
if (this.pos.config.is_comptoir) {
self.gui.show_screen(self.next_screen);
}
else{
self.gui.show_popup('confirm-pesee',{
'title': _t('Merci'),
'body': _t('Contenant ajouté, vous pouvez vous servir'),
confirm: function(){
self.gui.show_screen(self.next_screen);
},
});
}
},
close: function(){
this._super();
if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) {

6
static/src/js/models_and_db.js

@ -152,6 +152,12 @@ odoo.define('vracoop_pos_free_balance_v2.models_and_db_balance', function (requi
}
},
get_is_comptoir: function(){
if (this.config.is_comptoir) {
return this.config.is_comptoir;
}
},
// load_placeholder_transactions: function(){
// var self = this;
// var fields = _.find(this.models,function(model){

4
views/pos_config_views.xml

@ -22,6 +22,10 @@
<label for="balance_id" class="col-lg-3 o_light_label"/>
<field name="balance_id" attrs="{'required': [('is_balance_free', '=', True)]}"/>
</div>
<div class="row mt16">
<label for="is_comptoir" class="col-lg-3 o_light_label"/>
<field name="is_comptoir"/>
</div>
<div class="row mt16">
<label for="logo_balance" class="col-lg-3 o_light_label"/>
<field name="logo_balance" widget="image"/>

Loading…
Cancel
Save