Files
odoo_source/addons/website/views/website_views.xml
T
Yannick Tivisse 7e008469e4 [IMP] base: Always load menuitem xmlids on templates
PURPOSE
=======

Currently we can choose to load the xmlid of a menuitem if web_tour is installed by setting the attribute `load_xmlid=True` on the view.

This is strange for 2 reasons:
- Searching all the ir.model.data on menuitems with load_xmlid=True to compute its xmlid, searching the related subtree on the returned structure of the method load_menus is quite complicated for the perfomance gain (if there is any perfomance gain to do it)
- This is not working in community in frontend, as only the root menuitems are loaded, thus it is the `load_menus_root` instead of the `load_menus` that is called. This issue prevent a tour step to be displayed correctly on community and enterprise on a menuitem.

SPECIFICATION
=============

Remove all the `load_xmlid` attributes and the related mechanism and move it into base to always load the xmlids for all the menuitems. It won't bee to heavy as the result is cached.

It's better the keep the current mechanism (Load the xmlids from ir.model.data and insert them into the tree) as we only make 1 search to the ir.model.data
2017-05-26 13:13:12 +02:00

142 lines
6.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Menu items -->
<menuitem name="Website"
id="menu_website_configuration"
sequence="9"
groups="base.group_user"
web_icon="website,static/description/icon.png"/>
<!-- website views -->
<record id="view_website_form" model="ir.ui.view">
<field name="name">website.form</field>
<field name="model">website</field>
<field name="arch" type="xml">
<form string="Website Settings">
<header>
<button string="Apply" type="object" name="noop" class="oe_highlight"/>
<button string="Cancel" type="object" name="noop" class="oe_link"/>
</header>
<div name="domain">
<separator name="domain" string="Domain"/>
<group name="domain">
<field name="name"/>
<field name="domain"/>
<field name="google_analytics_key" placeholder="UA-XXXXXXXX-Y"/>
</group>
</div>
<div name="social_media">
<separator string="Social Media"/>
<group name="social_media">
<field name="social_twitter" placeholder="https://twitter.com/Odoo"/>
<field name="social_facebook" placeholder="https://www.facebook.com/odoo"/>
<field name="social_googleplus" placeholder="https://plus.google.com/+Odooapps"/>
<field name="social_linkedin" placeholder="https://www.linkedin.com/company/odoo"/>
<field name="social_youtube" placeholder="https://www.youtube.com/user/OpenERPonline"/>
<field name="social_github" placeholder="https://youraccount.github.io"/>
</group>
</div>
<div name="other">
<separator string="Other Info"/>
<group name="other">
<field name="company_id" groups="base.group_multi_company"/>
<field name="language_ids" widget="many2many_checkboxes"/>
<field name="default_lang_id" widget="selection"/>
</group>
</div>
</form>
</field>
</record>
<record id="view_website_tree" model="ir.ui.view">
<field name="name">website.tree</field>
<field name="model">website</field>
<field name="arch" type="xml">
<tree string="Websites">
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="default_lang_id"/>
</tree>
</field>
</record>
<!-- website.menu views -->
<record id="action_website_menu" model="ir.actions.act_window">
<field name="name">Website Menu</field>
<field name="res_model">website.menu</field>
<field name="view_mode">list</field>
<field name="context">{'search_default_my_websites':1}</field>
</record>
<record id="menu_tree" model="ir.ui.view">
<field name="name">website.menu.tree</field>
<field name="model">website.menu</field>
<field name="field_parent">child_id</field>
<field name="arch" type="xml">
<tree string="Website menu" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="website_id" options="{'no_create': True}"/>
<field name="name"/>
<field name="url"/>
<field name="new_window"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<record id="menu_search" model="ir.ui.view">
<field name="name">website.menu.search</field>
<field name="model">website.menu</field>
<field name="arch" type="xml">
<search string="Search Menus">
<field name="name"/>
<field name="url"/>
<field name="website_id"/>
<group string="Group By">
<filter string="name" domain="[]" context="{'group_by':'name'}"/>
<filter string="url" domain="[]" context="{'group_by':'url'}"/>
<filter string="website" name="my_websites" domain="[]" context="{'group_by':'website_id'}"/>
</group>
</search>
</field>
</record>
<!-- ir.ui.view views -->
<record model="ir.ui.view" id="view_view_form_extend">
<field name="model">ir.ui.view</field>
<field name="inherit_id" ref="base.view_view_form"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="website_id" readonly="1"/>
<field name="key" readonly="1"/>
</field>
</field>
</record>
<!-- Dashboard -->
<record id="backend_dashboard" model="ir.actions.client">
<field name="name">Dashboard</field>
<field name="tag">backend_dashboard</field>
</record>
<record id="ir_actions_server_website_dashboard" model="ir.actions.server">
<field name="name">Website: Dashboard</field>
<field name="model_id" ref="website.model_website"/>
<field name="state">code</field>
<field name="code">action = model.action_dashboard_redirect()</field>
</record>
<menuitem id="menu_dashboard"
name="Dashboard"
sequence="1"
action="website.ir_actions_server_website_dashboard"
parent="website.menu_website_configuration"/>
</data>
</odoo>