Professional Documents
Culture Documents
js) in build wi
dget function
//ADD Screen name of 'partnerlist' in main 'PosWidget'
this.partne_screen = new module.partneScreenWidget(this, {})
this.partne_screen.appendTo(this.$('.screens'));
2) when pos start we have to render screen
then
//this is the all screen that is use in pos
//we added our screen here
this.screen_selector = new module.ScreenSelector({
pos: this.pos,
screen_set:{
'products': this.product_screen,
'payment' : this.payment_screen,
'scale':
this.scale_screen,
'receipt' : this.receipt_screen,
'clientlist': this.clientlist_screen,
'partnerlist': this.partne_screen, //add screen name
of 'partnerlist' : this name is for js
},
popup_set:{
'error': this.error_popup,
'error-barcode': this.error_barcode_popup,
'error-traceback': this.error_traceback_popup,
'confirm': this.confirm_popup,
'unsent-orders': this.unsent_orders_popup,
},
default_screen: 'products',
default_mode: 'cashier',
});
clear with this point ? yes ( in widget.js ) ok
3) now finally we can add one widget which is render templat
e when buton click in (screen.js file_)
//basic widget that do all stuff and where we render tem
plate (xml)
//here 'partneScreenWidget' is widget name
'partnerListScreenWidget' is template na
me which is in static/src/xml folder
here we have to create 'partnerListScree
nWidget' template
module.partneScreenWidget = module.ScreenWidget.extend({
template: 'partnerListScreenWidget',
init: function(parent, options){
this._super(parent, options);
},
show_leftpane: false,
show: function(){
<t t-name="ClientListScreenWidget">
<div class="clientlist-screen screen">
<div class="screen-content">
<section class="top-content">
<span class='button back'>
<i class='fa fa-angle-double-left'></i>
Cancel
</span>
<span class='searchbox'>
<input placeholder='Search Customers' />
<span class='search-clear'></span>
</span>
<span class='searchbox'></span>
<span class='button new-customer'>
<i class='fa fa-user'></i>
<i class='fa fa-plus'></i>
</span>
<span class='button next oe_hidden highlight'>
Select Customer
<i class='fa fa-angle-double-right'></i>
</span>
<span class='button highlight' id="button-id"><!--add button
in this template -->
button
<i class='fa fa-angle-double-right'></i>
</span>
</section>
<section class="full-content">
<div class='window'>
<section class='subwindow collapsed'>
<div class='subwindow-container'>
<div class='subwindow-container-fix client-detai
ls-contents'>
</div>
</div>
</section>
<section class='subwindow'>
<div class='subwindow-container'>
<div class='subwindow-container-fix touch-scroll
able scrollable-y'>
<table class='client-list'>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone</th>
</tr>
</thead>
<tbody class='client-list-contents'>
</tbody>
</table>
</div>
</div>
</section>
</div>
</section>
</div>
</div>
</t>
show: function(){
var self = this;
this._super();
},
});
5) and at last we crete template of partnerListScreenWidget for
new screen like this
<!-- template for design screen and ui -->
<t t-name="partnerListScreenWidget">
<span>Hello your screen loaded... :)</span>
</t>