|
@ -81,30 +81,33 @@ odoo.define('vracoop_pos_free_balance_v2.container_balance', function (require) |
|
|
barcode_container_action: function(code){ |
|
|
barcode_container_action: function(code){ |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
if (self.pos.scan_container(code)) { |
|
|
|
|
|
var order = this.pos.get_order(); |
|
|
|
|
|
var selected_orderline = order.get_selected_orderline(); |
|
|
|
|
|
var container = selected_orderline.get_container(); |
|
|
|
|
|
// Vérfification: est-ce qu'un container vient d'être utilisé dans l'heure
|
|
|
|
|
|
if (self.pos.scan_container_check(code)){ |
|
|
|
|
|
var transaction = self.pos.scan_container_check(code); |
|
|
|
|
|
this.gui.show_popup('doublon-barcode',{ |
|
|
|
|
|
title: _t('Contenu déjà enregistré récemment:'), |
|
|
|
|
|
transaction: transaction, |
|
|
|
|
|
confirm: function(){ |
|
|
|
|
|
var transaction = self.pos.scan_container_check(code) |
|
|
|
|
|
self.delete_selected_transaction(transaction, code); |
|
|
|
|
|
self.gui.show_screen('products-balance', {container: container}); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if (this.pos.config.is_balance_free){ |
|
|
|
|
|
if (self.pos.scan_container(code)) { |
|
|
|
|
|
var order = this.pos.get_order(); |
|
|
|
|
|
var selected_orderline = order.get_selected_orderline(); |
|
|
|
|
|
var container = selected_orderline.get_container(); |
|
|
|
|
|
// Vérfification: est-ce qu'un container vient d'être utilisé dans l'heure
|
|
|
|
|
|
if (self.pos.scan_container_check(code)){ |
|
|
|
|
|
var transaction = self.pos.scan_container_check(code); |
|
|
|
|
|
this.gui.show_popup('doublon-barcode',{ |
|
|
|
|
|
title: _t('Contenu déjà enregistré récemment:'), |
|
|
|
|
|
transaction: transaction, |
|
|
|
|
|
confirm: function(){ |
|
|
|
|
|
var transaction = self.pos.scan_container_check(code) |
|
|
|
|
|
self.delete_selected_transaction(transaction, code); |
|
|
|
|
|
self.gui.show_screen('products-balance', {container: container}); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
self.gui.show_screen('products-balance', {container: container}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
self.gui.show_screen('products-balance', {container: container}); |
|
|
|
|
|
|
|
|
self.gui.show_screen('balancecontainerscale', {barcode: code.base_code}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
self.gui.show_screen('balancecontainerscale', {barcode: code.base_code}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
this._super(code); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
delete_selected_transaction: function(transaction, barcode){ |
|
|
delete_selected_transaction: function(transaction, barcode){ |
|
|