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.

155 lines
6.7 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright (C) 2017 MuK IT GmbH
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as
  6. published by the Free Software Foundation, either version 3 of the
  7. License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. -->
  15. <odoo>
  16. <record id="view_refresh_rule_search" model="ir.ui.view">
  17. <field name="name">muk_autovacuum_rules.search</field>
  18. <field name="model">muk_autovacuum.rules</field>
  19. <field name="arch" type="xml">
  20. <search string="Auto Vacuum Rules">
  21. <field name="name"/>
  22. <field name="model"/>
  23. <field name="state"/>
  24. <field name="active"/>
  25. <separator/>
  26. <filter string="All" name="all" domain="['|', ('active', '=', False), ('active', '=', True)]" />
  27. <group expand="0" string="Group By">
  28. <filter string="Model" domain="[]" context="{'group_by':'model'}"/>
  29. </group>
  30. </search>
  31. </field>
  32. </record>
  33. <record id="view_refresh_rule_tree" model="ir.ui.view">
  34. <field name="name">muk_autovacuum_rules.tree</field>
  35. <field name="model">muk_autovacuum.rules</field>
  36. <field name="arch" type="xml">
  37. <tree string="Auto Vacuum Rules" decoration-muted="(not active)">
  38. <field name="sequence" widget="handle"/>
  39. <field name="name"/>
  40. <field name="model"/>
  41. <field name="state"/>
  42. <field name="active"/>
  43. </tree>
  44. </field>
  45. </record>
  46. <record id="view_refresh_rule_form" model="ir.ui.view">
  47. <field name="name">muk_autovacuum_rules.form</field>
  48. <field name="model">muk_autovacuum.rules</field>
  49. <field name="arch" type="xml">
  50. <form string="Auto Vacuum Rules">
  51. <sheet>
  52. <div class="oe_button_box" name="button_box">
  53. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-bell">
  54. <field name="active" widget="boolean_button"/>
  55. </button>
  56. </div>
  57. <div class="oe_title">
  58. <label for="name" class="oe_edit_only"/>
  59. <h1>
  60. <field name="name" placeholder="e.g. Delete Logs after 30 Days"/>
  61. </h1>
  62. </div>
  63. <group>
  64. <group>
  65. <field name="sequence"/>
  66. <field name="model"/>
  67. <field name="model_name" invisible="1"/>
  68. <field name="state"/>
  69. </group>
  70. <group>
  71. <field name="protect_starred"/>
  72. <field name="only_inactive"/>
  73. <field name="only_attachments"/>
  74. </group>
  75. </group>
  76. <notebook>
  77. <page string="Time Settings" name='time' autofocus="autofocus"
  78. attrs="{'invisible': [('state', '!=', 'time')]}">
  79. <group>
  80. <group>
  81. <field name="time_field"/>
  82. </group>
  83. <group>
  84. <field name="time_type"/>
  85. <field name="time"/>
  86. </group>
  87. </group>
  88. </page>
  89. <page string="Size Settings" name='size' autofocus="autofocus"
  90. attrs="{'invisible': [('state', '!=', 'size')]}">
  91. <group>
  92. <group>
  93. <field name="size_type"/>
  94. </group>
  95. <group>
  96. <field name="size_parameter"
  97. attrs="{'invisible': [('size_type', '!=', 'parameter')]}"/>
  98. <field name="size_parameter_value"
  99. attrs="{'invisible': [('size_type', '!=', 'parameter')]}"/>
  100. <field name="size"
  101. attrs="{'invisible': [('size_type', '!=', 'fixed')]}"/>
  102. <field name="size_order"/>
  103. </group>
  104. </group>
  105. </page>
  106. <page string="Domain Settings" name='domain' autofocus="autofocus"
  107. attrs="{'invisible': [('state', '!=', 'domain')]}">
  108. <field name="domain" widget="domain" options="{'model': 'model_name'}" />
  109. </page>
  110. <page string="Code Settings" name='code' autofocus="autofocus"
  111. attrs="{'invisible': [('state', '!=', 'code')]}">
  112. <field name="code" widget="ace" options="{'mode': 'python'}"
  113. placeholder="Enter Python code here. Help about Python expression is available in the help tab of this document."/>
  114. </page>
  115. <page string="Help" attrs="{'invisible': [('state', '!=', 'code')]}">
  116. <group>
  117. <div style="margin-top: 4px;">
  118. <h3>Help with Python expressions</h3>
  119. <p>Various fields may use Python code or Python expressions. The following variables can be used:</p>
  120. <ul>
  121. <li><code>uid</code>, <code>user</code>: User on which the rule is triggered</li>
  122. <li><code>env</code>: Odoo Environment on which the rule is triggered</li>
  123. <li><code>model</code>: Odoo Model of the record on which the rule is triggered</li>
  124. <li><code>time</code>, <code>datetime</code>, <code>dateutil</code>, <code>timezone</code>: useful Python libraries</li>
  125. <li><code>date_format</code>, <code>datetime_format</code>: server date and time formats</li>
  126. <li><code>logger.info(message)</code>: Python logging framework</li>
  127. <li><code>Warning</code>: Warning Exception to use with <code>raise</code></li>
  128. </ul>
  129. </div>
  130. </group>
  131. </page>
  132. </notebook>
  133. </sheet>
  134. </form>
  135. </field>
  136. </record>
  137. <record id="action_rule" model="ir.actions.act_window">
  138. <field name="name">Auto Vacuum Rules</field>
  139. <field name="res_model">muk_autovacuum.rules</field>
  140. <field name="view_mode">tree,form</field>
  141. <field name="context">{'search_default_all': 1}</field>
  142. </record>
  143. <menuitem id="menu_rules" name="Auto Vacuum Rules"
  144. parent="base.menu_automation" action="action_rule"/>
  145. </odoo>