在pos Odoo-8中创建收据 [英] Create receipt in pos Odoo-8
本文介绍了在pos Odoo-8中创建收据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想先打印模板 PosTicket ,然后再付款(票的预览),我尝试使用模块"pos_restaurant" ,但不起作用, 有什么建议?.谢谢.
i'd like to print the template PosTicket before to pay it(preview of the ticket), I tried with the module "pos_restaurant" but doesn't work, any suggestions?. Thanks.
推荐答案
使用此代码创建js
/*按钮小部件*/
var PrintBillButtonTicket = screens.ActionButtonWidget.extend({
template: 'PrintBillButtonTicket',
print_xml: function(){
var order = this.pos.get('selectedOrder');
if(order.get_orderlines().length > 0){
var receipt = order.export_for_printing();
receipt.bill = true;
this.$('.pos-receipt-container').html(QWeb.render('PosTicket',{
widget:this,
order: order,
receipt: order.export_for_printing(),
orderlines: order.get_orderlines(),
paymentlines: order.get_paymentlines(),
}));
}
},
button_click: function(){
this.print_xml();
},
});
screens.define_action_button({
'name': 'print_billticket',
'widget': PrintBillButtonTicket,
});
在下面添加XML文件
<t t-name="PrintBillButtonTicket">
<span class="control-button order-printbillticket">
<i class="fa fa-print"></i>
Bill Print
</span>
</t>
这篇关于在pos Odoo-8中创建收据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文