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

  1. <?xml version="1.0" ?>
  2. <odoo>
  3. <record id="view_exception_rule_tree" model="ir.ui.view">
  4. <field name="name">exception.rule.tree</field>
  5. <field name="model">exception.rule</field>
  6. <field name="arch" type="xml">
  7. <tree string="Exception Rule">
  8. <field name="sequence" widget="handle"/>
  9. <field name="name"/>
  10. <field name="description"/>
  11. <field name="model"/>
  12. <field name="active" widget="boolean_toggle"/>
  13. </tree>
  14. </field>
  15. </record>
  16. <record id="view_exception_rule_form" model="ir.ui.view">
  17. <field name="name">exception.rule.form</field>
  18. <field name="model">exception.rule</field>
  19. <field name="arch" type="xml">
  20. <form string="Exception Rule Setup" name="exception_rule">
  21. <sheet>
  22. <div class="oe_button_box" name="button_box">
  23. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
  24. <field name="active" widget="boolean_button"/>
  25. </button>
  26. </div>
  27. <div class="oe_title">
  28. <label for="name" class="oe_edit_only"/>
  29. <h1><field name="name"/></h1>
  30. </div>
  31. <group>
  32. <group>
  33. <field name="description"/>
  34. </group>
  35. </group>
  36. <group>
  37. <group colspan="4" groups="base.group_system">
  38. <field name="rule_group"/>
  39. <field name="model"/>
  40. <field name="next_state"/>
  41. <field name="exception_type" widget="radio"/>
  42. <field name="domain" attrs="{'invisible': [('exception_type','!=','by_domain')]}"/>
  43. </group>
  44. </group>
  45. <notebook>
  46. <page name="code" string="Python Code" attrs="{'invisible': [('exception_type','!=','by_py_code')]}">
  47. <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."/>
  48. </page>
  49. <page name="help" string="Help" attrs="{'invisible': [('exception_type','!=','by_py_code')]}">
  50. <group>
  51. <div style="margin-top: 4px;">
  52. <h3>Help with Python expressions</h3>
  53. <p>Various fields may use Python code or Python expressions. The following variables can be used:</p>
  54. <ul>
  55. <li><code>self</code>: Record on which the rule is evaluated.</li>
  56. <li><code>time</code>: useful Python libraries</li>
  57. <li>To block the exception use: <code>failed = True</code></li>
  58. </ul>
  59. </div>
  60. </group>
  61. </page>
  62. </notebook>
  63. </sheet>
  64. </form>
  65. </field>
  66. </record>
  67. <record id="action_exception_rule_tree" model="ir.actions.act_window">
  68. <field name="name">Exception Rules</field>
  69. <field name="res_model">exception.rule</field>
  70. <field name="view_type">form</field>
  71. <field name="view_mode">tree,form</field>
  72. <field name="view_id" ref="view_exception_rule_tree"/>
  73. <field name="context">{'active_test': False}</field>
  74. </record>
  75. <menuitem
  76. action="action_exception_rule_tree"
  77. id="menu_action_exception"
  78. parent="base.menu_custom"
  79. sequence="90"
  80. groups="base_exception.group_exception_rule_manager"
  81. />
  82. </odoo>