[DONE] point_of_sale: disable validation button when order not fully paid

bzr revid: fva@openerp.com-20120831145606-nrk44gs60lab4k3l
This commit is contained in:
Frédéric van der Essen
2012-08-31 16:56:06 +02:00
parent b3ec8d7647
commit 9cfe5665a5
3 changed files with 10 additions and 4 deletions
+4 -2
View File
@@ -1072,12 +1072,14 @@
-webkit-transition-timing-function: ease-out;
}
.point-of-sale .pos-actionbar .button.disabled{
color:#AAA;
.point-of-sale .pos-actionbar .button.disabled *{
opacity: 0.5;
}
.point-of-sale .pos-actionbar .button.disabled:hover{
border: 1px solid #cacaca;
border-radius: 4px;
color: #555;
cursor: default;
background: #e2e2e2;
background: -webkit-linear-gradient(#f0f0f0, #e2e2e2);
@@ -741,6 +741,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
self.validateCurrentOrder();
},
});
this.updatePaymentSummary();
},
close: function(){
this._super();
@@ -807,7 +809,9 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.$('#payment-paid-total').html(paidTotal.toFixed(2));
this.$('#payment-remaining').html(remaining.toFixed(2));
this.$('#payment-change').html(change.toFixed(2));
this.pos_widget.action_bar.set_button_disabled('validation', remaining > 0);
if(this.pos_widget.action_bar){
this.pos_widget.action_bar.set_button_disabled('validation', remaining > 0);
}
},
set_numpad_state: function(numpadState) {
if (this.numpadState) {
@@ -433,7 +433,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
var button = new module.ActionButtonWidget(this,button_options);
this.button_list.push(button);
if(button_options.name){
this.buttons[name] = button;
this.buttons[button_options.name] = button;
}
button.appendTo(this.$('.pos-actionbar-button-list'));
return button;