Files
odoo_source/addons/website/views/res_config_settings_views.xml
T
Jorge Pinna PuissantandMichael Mattiello (mcm) c7c2959449 [IMP] web, *: simplification and standardization of the settings arch
The aim of this commit is to simplify and standardize the settings archs.

To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.

The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.

```xml
    <app string="CRM" name="crm">
    ...
    </app>
```

- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
        logo is created using the `name` parameter :
        `/{name}/static/description/icon.png`.

The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.

```xml
    <block title="Title of group Bar">
    ...
    </block>
```

- `title` *optional* : The title of the block of settings (the old h2),
        you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
        (the old h3), you can perform research on its text.

The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.

```xml
    <setting string="this is bar">
        <field name="bar"/>
        ...More elements
    </setting>
```

- `type` *optional* : By default, a setting is visually separated on two
        panels (left and right), and is used to edit a given field. By
        defining `type='header'`, a special kind of setting is rendered
        instead. This setting is used to modify the scope of the other
        settings. For example, on the website application, this setting
        is used to indicate to which website the other settings apply.
        The header setting is visually represented as a yellow banner on
        the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
        not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
        displayed just below the setting label (with classname
        `text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
        icon is displayed next to the setting label to explicit that
        this setting is company-specific.
- `documentation` *optional* :  If this attribute is set, an icon is
        added next to the setting label, this icon is a link to the
        documentation. Note that you can use relative or absolute path.
        The relative path is relative to
        `https://www.odoo.com/documentation/server_version`, so it's not
        necessary to hard-code the server version on the arch anymore.

closes odoo/odoo#106425

Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
2022-12-02 14:40:25 +01:00

225 lines
16 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_inherit_auth_signup" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.website</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="auth_signup.res_config_settings_view_form"/>
<field name="arch" type="xml">
<!-- Remove customer accounts setting from general settings tab -->
<!-- It must not be in the view at all to make sure settings can be saved
(because auth_signup_uninvited is specified as required) -->
<xpath expr="//setting[@id='login_documents']" position="replace"></xpath>
</field>
</record>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.website</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="20"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Website" string="Website" name="website" groups="website.group_website_designer">
<setting type="header" string="Settings of Website">
<field name="website_id" options="{'no_open': True, 'no_create': True}" title="Settings on this page will apply to this website"/>
<button name="action_website_create_new" type="object" string="+ New Website" class="col-auto btn-link ms-2 text-nowrap" style="line-height: 0.5;"/>
</setting>
<block title="Website Info" id="website_info_settings">
<setting>
<div class="content-group">
<div class="row mt8">
<label class="col-lg-3" string="Domain" for="website_domain"/>
<field name="website_domain" placeholder="https://www.odoo.com" title="Display this website when users visit this domain"/>
</div>
<div class="row mt8">
<label class="col-lg-3" string="Homepage URL" for="website_homepage_url"/>
<field name="website_homepage_url" placeholder="/" title="Main page of your website served to visitors"/>
</div>
<div class="row mt8">
<label class="col-lg-3" string="Languages" for="language_ids"/>
<field name="language_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" attrs="{'required': [('website_id', '!=', False)]}" title="Languages available on your website"/>
</div>
<div class="row mt8" attrs="{'invisible': [('website_language_count', '&lt;', 2)]}">
<field name="website_language_count" invisible="1"/>
<label class="col-lg-3" string="Default" for="website_default_lang_id"/>
<field name="website_default_lang_id" options="{'no_open': True, 'no_create': True}" attrs="{'required': [('website_id', '!=', False)]}"/>
</div>
<div class="mt8">
<button type="action" name="%(base.action_view_base_language_install)d" string="Install languages" class="btn-link" icon="fa-arrow-right"/>
</div>
</div>
</setting>
<setting>
<div class="content-group">
<div class="row mt8">
<label class="col-lg-3" string="Website Name" for="website_name"/>
<field name="website_name" attrs="{'required': [('website_id', '!=', False)]}"/>
</div>
<div class="row mt8" groups="base.group_multi_company">
<label class="col-lg-3" string="Company" for="website_company_id"/>
<field name="website_company_id" attrs="{'required': [('website_id', '!=', False)]}" title="The company this website belongs to"/>
</div>
<div class="row mt8">
<label class="col-lg-3" string="Favicon" for="favicon"/>
<field name="favicon" widget="image" class="float-start oe_avatar bg-view"/>
</div>
</div>
</setting>
</block>
<block title="Email &amp; Marketing" id="website_email_marketing">
<setting id="livechat" string="Livechat" help="Alows your visitors to chat with you">
<field name="module_website_livechat"/>
</setting>
<setting id="website_marketing_automation" string="Email Marketing" help="Allows to do mass mailing campaigns to contacts">
<field name="module_marketing_automation" widget="upgrade_boolean"/>
</setting>
</block>
<block title="Privacy" id="website_settings" attrs="{'invisible': [('website_id', '=', False)]}">
<setting id="website_cookies_bar_setting" help="Display a customizable cookies bar on your website">
<field name="website_cookies_bar"/>
</setting>
<setting id="shared_user_account_setting" groups="website.group_multi_website" help="Accounts are usable across all your multiple websites">
<field name="shared_user_account"/>
</setting>
<setting id="website_login_documents" title=" To send invitations in B2B mode, open a contact or select several ones in list view and click on 'Portal Access Management' option in the dropdown menu *Action*." help="Let your customers log in to see their documents">
<field name="auth_signup_uninvited" class="o_light_label" widget="radio" options="{'horizontal': true}" required="True"/>
<div class="content-group" attrs="{'invisible': [('auth_signup_uninvited','=','b2b')]}">
<div class="mt8">
<button type="object" name="action_open_template_user" string="Default Access Rights" icon="fa-arrow-right" class="btn-link"/>
</div>
</div>
</setting>
</block>
<block title="SEO" id="website_settings" attrs="{'invisible': [('website_id', '=', False)]}">
<setting id="google_analytics_setting" help="Track visits using Google Analytics">
<field name="has_google_analytics"/>
<div class="content-group" attrs="{'invisible': [('has_google_analytics', '=', False)]}">
<div class="row mt16">
<label class="col-lg-3 o_light_label" string="Measurement ID" for="google_analytics_key"/>
<field name="google_analytics_key" placeholder="G-XXXXXXXXXX"
attrs="{'required': [('has_google_analytics', '=', True)]}"/>
</div>
</div>
<div attrs="{'invisible': [('has_google_analytics', '=', False)]}">
<a href="https://www.odoo.com/documentation/master/applications/websites/website/optimize/google_analytics.html"
class="oe_link" target="_blank">
<i class="fa fa-arrow-right"/>
How to get my Measurement ID
</a>
</div>
</setting>
<setting id="cdn_setting" title="A CDN helps you serve your website’s content with high availability and high performance to any visitor wherever they are located." groups="base.group_no_one" help="Use a CDN to optimize the availability of your website's content">
<field name="cdn_activated"/>
<div class="content-group" attrs="{'invisible': [('cdn_activated', '=', False)]}">
<div class="row mt16">
<label class="col-lg-3 o_light_label" for="cdn_url"/>
<field name="cdn_url"
attrs="{'required': [('cdn_activated', '=', True)]}"
placeholder="//mycompany.mycdn.com/"
t-translation="off"/>
</div>
<div class="row" >
<label class="col-lg-3 o_light_label" for="cdn_filters"/>
<field name="cdn_filters" class="oe_inline"
attrs="{'required': [('cdn_activated', '=', True)]}"/>
</div>
</div>
</setting>
<setting id="robots_setting" string="Robots.txt" help="Robots.txt: This file tells to search engine crawlers which pages or files they can or can't request from your site.">
<div class="mt4">
<button type="object" name="action_open_robots" string="Edit robots.txt" class="btn-link" icon="fa-android" noSaveDialog="true"/>
</div>
</setting>
<setting id="robots_setting" string="Sitemap" help="Sitemap.xml: Help search engine crawlers to find out what pages are present and which have recently changed, and to crawl your site accordingly. This file is automatically generated by Odoo.">
<div class="mt4">
<button type="object" name="action_ping_sitemap" string="Submit sitemap to Google" class='btn-link' icon="fa-google" noSaveDialog="true"/>
</div>
</setting>
<setting id="social_default_image_setting" string="Default Social Share Image" help="If set, replaces the website logo as the default social share image.">
<field name="has_default_share_image"/>
<field name="social_default_image" widget="image" class="w-25 mt-2" attrs="{'invisible': [('has_default_share_image', '=', False)]}"/>
</setting>
<setting id="google_console_setting" help="Monitor Google Search results data">
<field name="has_google_search_console"/>
<div class="content-group" attrs="{'invisible': [('has_google_search_console', '=', False)]}">
<div class="row mt16">
<label class="col-lg-3 o_light_label" string="Code" for="google_search_console"/>
<field name="google_search_console" placeholder="google1234567890123456.html"
attrs="{'required': [('has_google_search_console', '=', True)]}"/>
</div>
</div>
<div attrs="{'invisible': [('has_google_search_console', '=', False)]}">
<small class='text-muted'>
<i class="fa fa-info"/>: type some of the first chars after 'google' is enough, we'll guess the rest.
</small>
</div>
</setting>
<setting id="plausbile_setting" help="Use Plausible.io, Simple and privacy-friendly Google Analytics alternative">
<field name="has_plausible_shared_key"/>
<div class="content-group" attrs="{'invisible': [('has_plausible_shared_key', '=', False)]}">
<div class="row mt16">
<label class="col-lg-3 o_light_label" string="Shared Link Auth" for="plausible_shared_key"/>
<field name="plausible_shared_key"
attrs="{'required': [('has_plausible_shared_key', '=', True)]}"/>
</div>
<div class="row mt16">
<label class="col-lg-3 o_light_label" string="Site" for="plausible_site"/>
<field name="plausible_site"
attrs="{'required': [('has_plausible_shared_key', '=', True)]}"/>
</div>
</div>
<div attrs="{'invisible': [('has_plausible_shared_key', '=', False)]}">
<a href="https://www.odoo.com/documentation/master/applications/websites/website/optimize/plausible.html"
class="oe_link" target="_blank">
<i class="fa fa-arrow-right"/>
How to create my Plausible Shared Link
</a>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
<record id="action_website_configuration" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'website', 'bin_size': False}</field>
</record>
<menuitem id="menu_website_global_configuration" parent="menu_website_configuration"
sequence="100" name="Configuration" groups="base.group_system"/>
<menuitem name="Settings"
id="menu_website_website_settings"
action="action_website_configuration"
parent="menu_website_global_configuration"
groups="base.group_system"
sequence="10"/>
<menuitem id="menu_website_add_features" parent="website.menu_website_global_configuration"
sequence="20" groups="base.group_system" action="action_website_add_features"/>
<menuitem name="Websites"
id="menu_website_websites_list"
action="action_website_list"
parent="menu_website_global_configuration"
groups="base.group_no_one"
sequence="10"
/>
<menuitem name="Menus"
id="menu_website_menu_list"
action="action_website_menu"
parent="menu_website_global_configuration"
sequence="45"
groups="base.group_no_one"/>
</odoo>