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.
 
 
 

87 lines
4.0 KiB

<?xml version="1.0" ?>
<odoo>
<record id="view_exception_rule_tree" model="ir.ui.view">
<field name="name">exception.rule.tree</field>
<field name="model">exception.rule</field>
<field name="arch" type="xml">
<tree string="Exception Rule">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="description"/>
<field name="model"/>
<field name="active" widget="boolean_toggle"/>
</tree>
</field>
</record>
<record id="view_exception_rule_form" model="ir.ui.view">
<field name="name">exception.rule.form</field>
<field name="model">exception.rule</field>
<field name="arch" type="xml">
<form string="Exception Rule Setup" name="exception_rule">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="description"/>
</group>
</group>
<group>
<group colspan="4" groups="base.group_system">
<field name="rule_group"/>
<field name="model"/>
<field name="next_state"/>
<field name="exception_type" widget="radio"/>
<field name="domain" attrs="{'invisible': [('exception_type','!=','by_domain')]}"/>
</group>
</group>
<notebook>
<page name="code" string="Python Code" attrs="{'invisible': [('exception_type','!=','by_py_code')]}">
<field name="code" widget="ace" options="{'mode': 'python'}" placeholder="Enter Python code here. Help about Python expression is available in the help tab of this document."/>
</page>
<page name="help" string="Help" attrs="{'invisible': [('exception_type','!=','by_py_code')]}">
<group>
<div style="margin-top: 4px;">
<h3>Help with Python expressions</h3>
<p>Various fields may use Python code or Python expressions. The following variables can be used:</p>
<ul>
<li><code>self</code>: Record on which the rule is evaluated.</li>
<li><code>time</code>: useful Python libraries</li>
<li>To block the exception use: <code>failed = True</code></li>
</ul>
</div>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="action_exception_rule_tree" model="ir.actions.act_window">
<field name="name">Exception Rules</field>
<field name="res_model">exception.rule</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_exception_rule_tree"/>
<field name="context">{'active_test': False}</field>
</record>
<menuitem
action="action_exception_rule_tree"
id="menu_action_exception"
parent="base.menu_custom"
sequence="90"
groups="base_exception.group_exception_rule_manager"
/>
</odoo>