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.

231 lines
11 KiB

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