Create receipt in pos Odoo-8

☆樱花仙子☆ 提交于 2020-01-11 13:05:44

问题


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.


回答1:


Create a js using this code

/* Button Widget */

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,

});

Add XML File Below

<t t-name="PrintBillButtonTicket">
        <span class="control-button order-printbillticket">
            <i class="fa fa-print"></i>
            Bill Print
        </span>
    </t>


来源:https://stackoverflow.com/questions/49758886/create-receipt-in-pos-odoo-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!