Friday 18 September 2015

How to inherit / modify point of sale pages & change Default Screen? | Odoo

Point of sale odoo have multiple screen and all screen set from screen.js in point_of_sale module. for inherit that file and change default screen you have to do like this :

  •  First you have to inherit widget and widget method in your module like this :
module.PosWidget.include{(
    build_widgets: function() {
       var self = this;
       this.screen_selector = new module.ScreenSelector({
            pos: this.pos,
            screen_set:{
                'products': this.product_screen,
                'payment' : this.payment_screen,
                'scale':    this.scale_screen,
                'receipt' : this.receipt_screen,
                'clientlist': this.clientlist_screen,
            },
            popup_set:{
                'error': this.error_popup,
                'error-barcode': this.error_barcode_popup,
                'error-traceback': this.error_traceback_popup,
                'confirm': this.confirm_popup,
                'unsent-orders': this.unsent_orders_popup,
            },
                default_screen: 'clientlist', #here you select your default screen 
                default_mode: 'cashier',
        });
    };
)}; 

No comments:

Post a Comment