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.

201 lines
8.5 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <menuitem id="menu_audit" name="Audit"
  4. parent="base.menu_custom" sequence="50"
  5. groups="base.group_system"/>
  6. <!-- auditlog.rule -->
  7. <record model="ir.ui.view" id="view_auditlog_rule_form">
  8. <field name="name">auditlog.rule.form</field>
  9. <field name="model">auditlog.rule</field>
  10. <field name="arch" type="xml">
  11. <form string="Rule">
  12. <header>
  13. <button string="Subscribe" name="subscribe"
  14. type="object" states="draft" class="oe_highlight"/>
  15. <button string="Unsubscribe" name="unsubscribe"
  16. type="object" states="subscribed"/>
  17. <field name="state" widget="statusbar"/>
  18. </header>
  19. <sheet>
  20. <group string="Rule">
  21. <group colspan="1">
  22. <field name="name" required="1"/>
  23. <field name="model_id"/>
  24. <field name="log_type"/>
  25. <field name="action_id" readonly="1" groups="base.group_no_one"/>
  26. </group>
  27. <group colspan="1">
  28. <field name="log_read"/>
  29. <field name="log_write"/>
  30. <field name="log_unlink"/>
  31. <field name="log_create"/>
  32. </group>
  33. </group>
  34. </sheet>
  35. </form>
  36. </field>
  37. </record>
  38. <record model="ir.ui.view" id="view_auditlog_rule_tree">
  39. <field name="name">auditlog.rule.tree</field>
  40. <field name="model">auditlog.rule</field>
  41. <field name="arch" type="xml">
  42. <tree colors="blue:state == 'draft';black:state == 'subscribed'" string="Rules">
  43. <field name="name"/>
  44. <field name="model_id"/>
  45. <field name="log_type"/>
  46. <field name="log_read"/>
  47. <field name="log_write"/>
  48. <field name="log_unlink"/>
  49. <field name="log_create"/>
  50. <field name="state"/>
  51. </tree>
  52. </field>
  53. </record>
  54. <record id="view_auditlog_rule_search" model="ir.ui.view">
  55. <field name="name">auditlog.rule.search</field>
  56. <field name="model">auditlog.rule</field>
  57. <field name="arch" type="xml">
  58. <search string="Rules">
  59. <field name="name"/>
  60. <filter name="state_draft"
  61. domain="[('state','=','draft')]" string="Draft"/>
  62. <filter name="state_subscribed"
  63. domain="[('state','=','subscribed')]" string="Subscribed"/>
  64. <field name="model_id"/>
  65. <group expand="0" string="Group By...">
  66. <filter name="group_by_state" string="State"
  67. domain="[]" context="{'group_by':'state'}"/>
  68. </group>
  69. </search>
  70. </field>
  71. </record>
  72. <record model="ir.actions.act_window" id="action_auditlog_rule_tree">
  73. <field name="name">Rules</field>
  74. <field name="res_model">auditlog.rule</field>
  75. <field name="type">ir.actions.act_window</field>
  76. <field name="view_type">form</field>
  77. <field name="view_mode">tree,form</field>
  78. <field name="context">{}</field>
  79. <field name="search_view_id" ref="view_auditlog_rule_search"/>
  80. </record>
  81. <menuitem id="menu_action_auditlog_rule_tree" parent="menu_audit" action="action_auditlog_rule_tree"/>
  82. <!-- auditlog.log -->
  83. <record model="ir.ui.view" id="view_auditlog_log_form">
  84. <field name="name">auditlog.log.form</field>
  85. <field name="model">auditlog.log</field>
  86. <field name="arch" type="xml">
  87. <form string="Log">
  88. <sheet>
  89. <group string="Log">
  90. <group colspan="1">
  91. <field name="create_date" readonly="1"/>
  92. <field name="user_id" readonly="1"/>
  93. <field name="method" readonly="1"/>
  94. <field name="log_type" readonly="1"/>
  95. </group>
  96. <group colspan="1">
  97. <field name="model_id" readonly="1"/>
  98. <field name="res_id" readonly="1"/>
  99. <field name="name" readonly="1"/>
  100. </group>
  101. </group>
  102. <group string="HTTP Context">
  103. <field name="http_session_id"/>
  104. <field name="http_request_id"/>
  105. </group>
  106. <group string="Fields updated">
  107. <field name="line_ids" readonly="1" nolabel="1">
  108. <form string="Log - Field updated">
  109. <group>
  110. <field name="field_id" readonly="1"/>
  111. </group>
  112. <group string="Values" col="4">
  113. <field name="old_value" readonly="1"/>
  114. <field name="new_value" readonly="1"/>
  115. <field name="old_value_text" readonly="1"/>
  116. <field name="new_value_text" readonly="1"/>
  117. </group>
  118. </form>
  119. <tree>
  120. <field name="field_description"/>
  121. <field name="field_name"/>
  122. <!--<field name="old_value"/>-->
  123. <field name="old_value_text"/>
  124. <!--<field name="new_value"/>-->
  125. <field name="new_value_text"/>
  126. </tree>
  127. </field>
  128. </group>
  129. </sheet>
  130. </form>
  131. </field>
  132. </record>
  133. <record model="ir.ui.view" id="view_auditlog_log_tree">
  134. <field name="name">auditlog.log.tree</field>
  135. <field name="model">auditlog.log</field>
  136. <field name="arch" type="xml">
  137. <tree string="Logs" create="false">
  138. <field name="create_date"/>
  139. <field name="name"/>
  140. <field name="model_id"/>
  141. <field name="res_id"/>
  142. <field name="method"/>
  143. <field name="user_id"/>
  144. </tree>
  145. </field>
  146. </record>
  147. <record id="view_auditlog_log_search" model="ir.ui.view">
  148. <field name="name">auditlog.log.search</field>
  149. <field name="model">auditlog.log</field>
  150. <field name="arch" type="xml">
  151. <search string="Logs">
  152. <field name="name"/>
  153. <field name="model_id"/>
  154. <field name="res_id"/>
  155. <field name="user_id"/>
  156. <group expand="0" string="Group By...">
  157. <filter name="group_by_user_id"
  158. string="User"
  159. domain="[]" context="{'group_by':'user_id'}"/>
  160. <filter name="group_by_model_id"
  161. string="Model"
  162. domain="[]" context="{'group_by':'model_id'}"/>
  163. <filter name="group_by_res_id"
  164. string="Resource ID"
  165. domain="[]" context="{'group_by':'res_id'}"/>
  166. <filter name="group_by_create_date"
  167. string="Date"
  168. domain="[]" context="{'group_by':'create_date'}"/>
  169. <filter name="group_by_http_session"
  170. string="User session"
  171. domain="[]" context="{'group_by':'http_session_id'}"/>
  172. <filter name="group_by_http_request"
  173. string="HTTP Request"
  174. domain="[]" context="{'group_by':'http_request_id'}"/>
  175. </group>
  176. </search>
  177. </field>
  178. </record>
  179. <record model="ir.actions.act_window" id="action_auditlog_log_tree">
  180. <field name="name">Logs</field>
  181. <field name="res_model">auditlog.log</field>
  182. <field name="view_type">form</field>
  183. <field name="search_view_id" ref="view_auditlog_log_search"/>
  184. </record>
  185. <menuitem id="menu_audit_logs" name="Logs"
  186. parent="menu_audit" action="action_auditlog_log_tree"/>
  187. </odoo>