Search 1.9 billion lines of Odoo code on GitHub

web_custom_modifier

Author: Numigi
License: LGPL-3
Branch: TA#47984
Repository: Numigi/odoo-web-addons
Dependencies: base
Languages: PO File (72, 16.1%), Python (286, 63.8%), XML (46, 10.3%), and reStructuredText (44, 9.8%)
Other branches: 12.0, 12.0-web_list_column_text_align, 14.0, TA#48575, and TA#48575-1

<h1 class="title">Web Custom Modifier</h1> <p>This module allows to customize modifiers on form view nodes.</p> <p>For example, it allows to make a field readonly, invisible or required.</p> <div class="contents topic" id="table-of-contents"> <p class="topic-title">Table of Contents</p> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#advanced-usage" id="id2">Advanced Usage</a></li> <li><a class="reference internal" href="#hide-selection-item" id="id3">Hide Selection Item</a></li> <li><a class="reference internal" href="#force-save" id="id4">Force Save</a></li> <li><a class="reference internal" href="#excluded-groups" id="id5">Excluded Groups</a></li> <li><a class="reference internal" href="#custom-widget" id="id6">Custom Widget</a></li> <li><a class="reference internal" href="#number-of-lines-per-page-list-views" id="id7">Number of lines per page (List Views)</a></li> <li><a class="reference internal" href="#contributors" id="id8">Contributors</a></li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>As system administrator, I go to <cite>Settings / Technical / User Interface / Custom Modifiers</cite>.</p> <img alt="static/description/custom_modifier_menu.png" src="static/description/custom_modifier_menu.png" /> <p>I create a new custom modifier.</p> <img alt="static/description/new_custom_modifier.png" src="static/description/new_custom_modifier.png" /> <p>The modifier is configured to make the field <code>default_code</code> of a product required.</p> <p>After refreshing my screen, I go to the form view of a product.</p> <p>I notice that the field <code>default_code</code> is required.</p> <img alt="static/description/product_form.png" src="static/description/product_form.png" /> <a name="advanced-usage"></a> <h2><a class="toc-backref" href="#id2">Advanced Usage</a></h2> <p>In the field <code>Type</code>, I can select <code>Xpath</code>. This allows to set a modifier for a specific view node, such as a button.</p> <img alt="static/description/button_modifier.png" src="static/description/button_modifier.png" /> <p>The example above hides the a button in the form view of a product.</p> <a name="hide-selection-item"></a> <h2><a class="toc-backref" href="#id3">Hide Selection Item</a></h2> <p>The module allows to hide an item (option) of a selection field.</p> <img alt="static/description/hide_selection_item_modifier.png" src="static/description/hide_selection_item_modifier.png" /> <p>The above example hides the type of address <code>Other</code>.</p> <img alt="static/description/contact_form_without_selection_item.png" src="static/description/contact_form_without_selection_item.png" /> <p>Beware that if the hidden option is already selected on a record, it will look as it was never set.</p> <img alt="static/description/contact_form_type_not_selected.png" src="static/description/contact_form_type_not_selected.png" /> <p>Therefore, this feature should only be used to hide options that are never used.</p> <a name="force-save"></a> <h2><a class="toc-backref" href="#id4">Force Save</a></h2> <p>A new option <code>Force Save</code> is available.</p> <img alt="static/description/force_save_modifier.png" src="static/description/force_save_modifier.png" /> <p>This modifier may be used along with the <code>Readonly</code> modifier so that the field value is saved to the server.</p> <a name="excluded-groups"></a> <h2><a class="toc-backref" href="#id5">Excluded Groups</a></h2> <p>A new field <code>Excluded Groups</code> is available.</p> <img alt="static/description/excluded_groups.png" src="static/description/excluded_groups.png" /> <p>If at least one group of users is selected, the modifier is not applied for users that are member of any of these groups.</p> <p>This is useful when rendering an element readonly or invisible only for a subset of users.</p> <a name="custom-widget"></a> <h2><a class="toc-backref" href="#id6">Custom Widget</a></h2> <p>It is possible to customize the widget used for a given field.</p> <img alt="static/description/custom_widget.png" src="static/description/custom_widget.png" /> <img alt="static/description/task_form_with_custom_widget.png" src="static/description/task_form_with_custom_widget.png" /> <a name="number-of-lines-per-page-list-views"></a> <h2><a class="toc-backref" href="#id7">Number of lines per page (List Views)</a></h2> <p>A new modifier is added to set the number of lines per page in list view.</p> <p>In the following example, we set a limit of 20 sale order lines per page on a sale order form view.</p> <img alt="static/description/number_lines_per_page_modifier.png" src="static/description/number_lines_per_page_modifier.png" /> <p>Result:</p> <img alt="static/description/sale_order_with_limited_sol_per_page.png" src="static/description/sale_order_with_limited_sol_per_page.png" /> <a name="contributors"></a> <h2><a class="toc-backref" href="#id8">Contributors</a></h2> <ul class="simple"> <li>Numigi (tm) and all its contributors (<a class="reference external" href="https://bit.ly/numigiens">https://bit.ly/numigiens</a>)</li> </ul>