中国本土应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3.0KB

Widget 使用说明

返回目录

专业版升级提示弹框

功能:开发者可以在 视图 res_config_settings_view_form 中添加标签 <widget name="oec_pro_upgrade_boolean" /> 来引流到自己的项目中。

<div class="col-12 col-lg-6 o_setting_box" id="rainbow_community_theme_install">
    <div class="o_setting_left_pane">
        <field name="module_rainbow_community_theme" widget="oec_pro_upgrade_boolean" url="https://eis-solution.coding.net/public/odoo/oec/git" image="/web/static/img/enterprise_upgrade.jpg"/>
    </div>
    <div class="o_setting_right_pane" id="rainbow_community_theme_settings">
        <label for="module_rainbow_community_theme"/>
        <div class="text-muted">
            This module modifies the web addon to provide responsiveness.
        </div>
        <div class="content-group" attrs="{'invisible': [('module_rainbow_community_theme', '=', False)]}" id="rainbow_community_theme_warning">
            <div class="mt4 text-warning">
                <strong>Save</strong> this page and come back here to set up other feature.
            </div>
        </div>
    </div>
</div>

说明:

  1. <field>标签的 widget 属性值为 oec_pro_upgrade_boolean,表示使用oec_pro_upgrade_boolean组件
  2. <field>标签的 url 属性值缺省值为 https://eis-solution.coding.net/public/odoo/oec/git
  3. <field>标签的 image 属性值缺省值为 /web/static/img/enterprise_upgrade.jpg

一对多配置

功能:显示配置帮助说明

<field name="contacts_app_config_ids" class="w-100 pl-3" widget="one2many_config" help="description" t-translation="off">
    <tree create="0" edit="true" delete="0" editable="bottom" sample="1">
        <field name="name" readonly="1"/>
        <field name="key" readonly="1"/>
        <field name="value" need_format="true" force_save="1" required="1"/>
        <field name="description" invisible="1"/>
    </tree>
</field>

说明:

  1. <field>标签的widget属性值为one2many_config,表示使用one2many_config组件
  2. <field>标签的help属性值为description,表示使用description字段的值作为one2many_config组件的help属性值
  3. <field>标签的t-translation属性值务必为off,否则会导致one2many_config组件的help属性值无法正常显示
  4. <tree> 建议属性如:create="0" edit="true" delete="0", <tree>中的需要对应help的字段,且必须设置invisible="1"

文本字符串密码化

功能:使用字体来处理密码,避免浏览器记住密码文本

<field name="contacts_secret" widget="DisplayPasswordChar" require_encryption="True" />

说明:

  1. <field>标签的widget属性值为DisplayPasswordChar,表示使用DisplayPasswordChar组件
  2. <field>标签的require_encryption缺省值为true,表示使用DisplayPasswordChar组件时,必须加密字符串
上海开阖软件有限公司 沪ICP备12045867号-1