在 pos Odoo-8 中创建收据

Create receipt in pos Odoo-8

我想在付款前打印模板 PosTicket(机票预览),我尝试使用模块 "pos_restaurant" 但不起作用,有什么建议吗?。谢谢。

使用此代码创建一个 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>