Create receipt in pos Odoo-8

前端 未结 1 1549
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 20:06

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

相关标签:
1条回答
  • 2021-01-28 20:50

    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>
    
    0 讨论(0)
提交回复
热议问题