def menupath_role(typ, rawtext, text, *args, **kwargs): a = resolve_action(text) mi = find_menu_item(a) if mi is None: raise Exception("Unknown menu descriptor %s" % text) text = menuselection_text(mi) rawtext = menuselection(mi) return menusel_role('menuselection', rawtext, text, *args, **kwargs)
def menupath_role(typ, rawtext, text, *args, **kwargs): a = resolve_action(text) user_type = UserTypes.get_by_value('900') mi = user_type.find_menu_item(a) if mi is None: raise Exception("Unknown menu descriptor %s" % text) text = menuselection_text(mi) rawtext = menuselection(mi) return menusel_role('menuselection', rawtext, text, *args, **kwargs)
def odoomenu_role(name, rawtext, text, lineno, inliner, options={}, content=[]): app = inliner.document.settings.env.app config = app.config module_name, menu_name = text.split('/') s = get_menu_data(module_name, menu_name, False, config.odoo_lang) s = s.replace('/', ' --> ') return roles.menusel_role('menuselection', rawtext, s, lineno, inliner, options, content)
def guilabel_role(typ, rawtext, text, *args, **kwargs): from sphinx.roles import menusel_role text = text.replace(u'->', u'\N{THIN SPACE}\N{RIGHTWARDS ARROW}\N{THIN SPACE}') return menusel_role(typ, rawtext, text, *args, **kwargs)