Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4366 Ansichten

In point of sale, How can I add a new screen widget in point of sale in which I can trigger it by a button


Avatar
Verwerfen
Beste Antwort
Code like below:

var HistoryButton = pos_screens.ActionButtonWidget.extend({
template: 'HistoryButton',
button_click: function () {
if (this.pos.get_client()) {
this.gui.show_screen('OrdersWidget');
}

},
});

pos_screens.define_action_button({
'name': 'History',
'widget': HistoryButton,
'condition': function(){
return this.pos;
},
});



var OrdersWidget = pos_screens.ScreenWidget.extend({
template: 'OrdersWidget',

init: function(parent, options){

},


show: function(){
var self = this;
this._super();

this.renderElement();
this.details_visible = false;

this.$('.back').click(function(){
self.gui.show_screen('products');
});

},
hide: function () {
this._super();
this.new_client = null;
},


close: function(){
this._super();
},
});
gui.define_screen({name:'OrdersWidget', widget: OrdersWidget});



//----- xml file---------//

<t t-name="OrdersWidget">
<div class="clientlist-screen screen">
<div class="screen-content">

//------screen view----------//

</div>
</div>
</t>

<t t-name="HistoryButton">

<div class='control-button orders-list'>
<i class="fa fa-history" aria-hidden="true"></i>
History
</div>
</t>

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Nov. 19
2709
1
Aug. 19
2862
1
Juni 18
2994
2
Feb. 22
10635
4
Okt. 17
7378