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.9 KiB

  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_autovacuum_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" filter_domain="[('name', 'ilike', self)]" />
  22. <field name="model" />
  23. <field name="state" />
  24. <field name="active" />
  25. <filter string="All" name="all" domain="['|', ('active', '=', False), ('active', '=', True)]" />
  26. <group expand="0" name="group_by" string="Group By">
  27. <filter name="group_by_model" string="Model" domain="[]" context="{'group_by': 'model'}"/>
  28. </group>
  29. </search>
  30. </field>
  31. </record>
  32. <record id="view_autovacuum_rule_tree" model="ir.ui.view">
  33. <field name="name">muk_autovacuum_rules.tree</field>
  34. <field name="model">muk_autovacuum.rules</field>
  35. <field name="arch" type="xml">
  36. <tree string="Auto Vacuum Rules" decoration-muted="(not active)">
  37. <field name="sequence" widget="handle"/>
  38. <field name="name"/>
  39. <field name="model"/>
  40. <field name="state"/>
  41. <field name="active"/>
  42. </tree>
  43. </field>
  44. </record>
  45. <record id="view_autovacuum_rule_form" model="ir.ui.view">
  46. <field name="name">muk_autovacuum_rules.form</field>
  47. <field name="model">muk_autovacuum.rules</field>
  48. <field name="arch" type="xml">
  49. <form string="Auto Vacuum Rules">
  50. <sheet>
  51. <div class="oe_button_box" name="button_box">
  52. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-bell">
  53. <field name="active" widget="boolean_button"/>
  54. </button>
  55. </div>
  56. <div class="oe_title">
  57. <label for="name" class="oe_edit_only"/>
  58. <h1>
  59. <field name="name" placeholder="e.g. Delete Logs after 30 Days"/>
  60. </h1>
  61. </div>
  62. <group>
  63. <group>
  64. <field name="sequence"/>
  65. <field name="model"/>
  66. <field name="model_name" invisible="1"/>
  67. <field name="state"/>
  68. </group>
  69. <group>
  70. <field name="protect_starred"/>
  71. <field name="only_inactive"/>
  72. <field name="only_attachments"/>
  73. </group>
  74. </group>
  75. <notebook>
  76. <page string="Time Settings" name='time' autofocus="autofocus"
  77. attrs="{'invisible': [('state', '!=', 'time')]}">
  78. <group>
  79. <group>
  80. <field name="time_field"/>
  81. </group>
  82. <group>
  83. <field name="time_type"/>
  84. <field name="time"/>
  85. </group>
  86. </group>
  87. </page>
  88. <page string="Size Settings" name='size' autofocus="autofocus"
  89. attrs="{'invisible': [('state', '!=', 'size')]}">
  90. <group>
  91. <group>
  92. <field name="size_type"/>
  93. </group>
  94. <group>
  95. <field name="size_parameter"
  96. attrs="{'invisible': [('size_type', '!=', 'parameter')]}"/>
  97. <field name="size_parameter_value"
  98. attrs="{'invisible': [('size_type', '!=', 'parameter')]}"/>
  99. <field name="size"
  100. attrs="{'invisible': [('size_type', '!=', 'fixed')]}"/>
  101. <field name="size_order"/>
  102. </group>
  103. </group>
  104. </page>
  105. <page string="Domain Settings" name='domain' autofocus="autofocus"
  106. attrs="{'invisible': [('state', '!=', 'domain')]}">
  107. <field name="domain" widget="domain" options="{'model': 'model_name'}" />
  108. </page>
  109. <page string="Code Settings" name='code' autofocus="autofocus"
  110. attrs="{'invisible': [('state', '!=', 'code')]}">
  111. <field name="code" widget="ace" options="{'mode': 'python'}"
  112. placeholder="Enter Python code here. Help about Python expression is available in the help tab of this document."/>
  113. </page>
  114. <page string="Help" attrs="{'invisible': [('state', '!=', 'code')]}">
  115. <group>
  116. <div style="margin-top: 4px;">
  117. <h3>Help with Python expressions</h3>
  118. <p>Various fields may use Python code or Python expressions. The following variables can be used:</p>
  119. <ul>
  120. <li><code>uid</code>, <code>user</code>: User on which the rule is triggered</li>
  121. <li><code>env</code>: Odoo Environment on which the rule is triggered</li>
  122. <li><code>model</code>: Odoo Model of the record on which the rule is triggered</li>
  123. <li><code>b64encode</code>, <code>b64decode</code>: Base64 converter</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_autovacuum_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_autovacuum_rules" name="Auto Vacuum Rules"
  144. parent="base.menu_automation" action="action_autovacuum_rule"/>
  145. </odoo>