[docs]classSideshowMenuHandler(base.SideshowMenuHandler):""" Custom menu handler for Sideshow, which adds CORE-POS entries. """
[docs]defmake_customers_menu(self,request,**kwargs):""" This adds the entry for CORE-POS Members. """menu=super().make_customers_menu(request,**kwargs)menu['items'].extend([{'type':'sep'},{'title':"CORE-POS Members",'route':'corepos_members','perm':'corepos_members.list',},])returnmenu
[docs]defmake_products_menu(self,request,**kwargs):""" This adds the entry for CORE-POS Products. """menu=super().make_products_menu(request,**kwargs)menu['items'].extend([{'type':'sep'},{'title':"CORE-POS Products",'route':'corepos_products','perm':'corepos_products.list',},])returnmenu
[docs]defmake_other_menu(self,request,**kwargs):""" This adds the entry for CORE Office. """menu=super().make_other_menu(request,**kwargs)corepos=self.app.get_corepos_handler()url=corepos.get_office_url()ifurl:menu['items'].extend([{'title':"CORE Office",'url':url,'target':'_blank',},])returnmenu