[IMP] point_of_sale: add debug popup that displays unsent order data, for when localStorage is hard to inspect

Conflicts:
	addons/point_of_sale/static/src/js/widgets.js
This commit is contained in:
Frederic van der Essen 2014-07-22 15:27:34 +02:00
parent 85d697670c
commit 584a78a82b
4 changed files with 50 additions and 0 deletions

View File

@ -1671,6 +1671,9 @@ td {
font-size: 14px;
text-align: left;
font-family: 'Inconsolata';
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
}
.pos .popup .footer{
position:absolute;

View File

@ -418,6 +418,18 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
template: 'ErrorInvoiceTransferPopupWidget',
});
module.UnsentOrdersPopupWidget = module.PopUpWidget.extend({
template: 'UnsentOrdersPopupWidget',
show: function(options){
var self = this;
this._super(options);
this.renderElement();
this.$('.button.confirm').click(function(){
self.pos_widget.screen_selector.close_popup();
});
},
});
module.ScaleScreenWidget = module.ScreenWidget.extend({
template:'ScaleScreenWidget',

View File

@ -797,6 +797,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.$('.button.reference').click(function(){
self.pos.barcode_reader.scan(self.$('input.ean').val());
});
this.$('.button.show_orders').click(function(){
self.pos.pos_widget.screen_selector.show_popup('unsent-orders');
});
_.each(this.eans, function(ean, name){
self.$('.button.'+name).click(function(){
self.$('input.ean').val(ean);
@ -1088,6 +1091,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.confirm_popup = new module.ConfirmPopupWidget(this,{});
this.confirm_popup.appendTo(this.$el);
this.unsent_orders_popup = new module.UnsentOrdersPopupWidget(this,{});
this.unsent_orders_popup.appendTo(this.$el);
// -------- Misc ---------
this.close_button = new module.HeaderButtonWidget(this,{
@ -1144,6 +1150,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
'error-invoice-transfer': this.error_invoice_transfer_popup,
'error-traceback': this.error_traceback_popup,
'confirm': this.confirm_popup,
'unsent-orders': this.unsent_orders_popup,
},
default_screen: 'products',
default_mode: 'cashier',

View File

@ -686,6 +686,29 @@
</div>
</t>
<t t-name="UnsentOrdersPopupWidget">
<div class="modal-dialog">
<div class="popup popup-unsent-orders">
<p class="message">Unsent Orders</p>
<t t-if='widget.pos.db.get_orders().length === 0'>
<p class='comment'>
There are no unsent orders
</p>
</t>
<t t-if='widget.pos.db.get_orders().length > 0'>
<p class='comment traceback'>
<t t-esc='JSON.stringify(widget.pos.db.get_orders(),null,2)' />
</p>
</t>
<div class="footer">
<div class="button confirm">
Ok
</div>
</div>
</div>
</div>
</t>
<t t-name="Product">
<span class='product' t-att-data-product-id="product.id">
<div class="product-img">
@ -793,6 +816,11 @@
<li class="button reference">Reference</li>
</ul>
<p class="category">Unsent Orders</p>
<ul>
<li class="button show_orders">Show All Unsent Orders</li>
</ul>
<p class="category">Hardware Status</p>
<ul>
<li class="status weighting">Weighting</li>