[IMP] point_of_sale: new textinput popup

Conflicts:
	addons/point_of_sale/static/src/js/screens.js
	addons/point_of_sale/static/src/js/widgets.js
This commit is contained in:
Frederic van der Essen
2014-11-25 17:27:56 +01:00
committed by Frédéric van der Essen
parent c873bcb71b
commit fcde32d180
4 changed files with 62 additions and 1 deletions
+9 -1
View File
@@ -1911,7 +1911,15 @@ td {
height: 180px;
line-height:180px;
}
.pos .popup input {
font-size: 18px;
font-family: Lato;
padding: 4px;
border-radius: 3px;
border: solid 1px #cecece;
box-sizing: border-box;
width: 80%;
}
/* ********* The Webkit Scrollbar ********* */
.pos *::-webkit-scrollbar{
@@ -378,6 +378,38 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
},
});
module.TextInputPopupWidget = module.PopUpWidget.extend({
template: 'TextInputPopupWidget',
show: function(options){
var self = this;
this._super();
this.message = options.message || '';
this.comment = options.comment || '';
this.value = options.value || '';
this.renderElement();
this.$('.button.cancel').click(function(){
self.pos_widget.screen_selector.close_popup();
if( options.cancel ){
options.cancel.call(self);
}
});
this.$('.button.confirm').click(function(){
self.pos_widget.screen_selector.close_popup();
var value = self.$('input').val();
if( options.confirm ){
options.confirm.call(self,value);
}
});
},
});
module.ErrorNoClientPopupWidget = module.ErrorPopupWidget.extend({
template: 'ErrorNoClientPopupWidget',
});
module.ErrorInvoiceTransferPopupWidget = module.ErrorPopupWidget.extend({
template: 'ErrorInvoiceTransferPopupWidget',
});
@@ -1010,6 +1010,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.fullscreen_popup = new module.FullscreenPopup(this,{});
this.fullscreen_popup.appendTo(this.$el);
this.textinput_popup = new module.TextInputPopupWidget(this,{});
this.textinput_popup.appendTo(this.$el);
this.unsent_orders_popup = new module.UnsentOrdersPopupWidget(this,{});
this.unsent_orders_popup.appendTo(this.$el);
@@ -1076,6 +1079,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
'error': this.error_popup,
'error-barcode': this.error_barcode_popup,
'error-traceback': this.error_traceback_popup,
'textinput': this.textinput_popup,
'confirm': this.confirm_popup,
'fullscreen': this.fullscreen_popup,
'unsent-orders': this.unsent_orders_popup,
@@ -919,6 +919,23 @@
</div>
</t>
<t t-name="TextInputPopupWidget">
<div class="modal-dialog">
<div class="popup popup-textinput">
<p class="message"><t t-esc=" widget.message || '' " /></p>
<input type='text' t-att-value="widget.value || ''"></input>
<div class="footer">
<div class="button confirm">
Ok
</div>
<div class="button cancel">
Cancel
</div>
</div>
</div>
</div>
</t>
<t t-name="UnsentOrdersPopupWidget">
<div class="modal-dialog">
<div class="popup popup-unsent-orders">