ir_actions_views.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- ir.actions -->
  4. <record id="action_view" model="ir.ui.view">
  5. <field name="name">ir.actions.actions</field>
  6. <field name="model">ir.actions.actions</field>
  7. <field name="arch" type="xml">
  8. <form string="Action">
  9. <sheet>
  10. <group>
  11. <field name="name"/>
  12. <field name="type"/>
  13. </group>
  14. </sheet>
  15. </form>
  16. </field>
  17. </record>
  18. <record id="action_view_tree" model="ir.ui.view">
  19. <field name="name">ir.actions.actions.tree</field>
  20. <field name="model">ir.actions.actions</field>
  21. <field name="arch" type="xml">
  22. <tree string="Action">
  23. <field name="name"/>
  24. <field name="type"/>
  25. </tree>
  26. </field>
  27. </record>
  28. <record id="action_view_search" model="ir.ui.view">
  29. <field name="name">ir.actions.actions.search</field>
  30. <field name="model">ir.actions.actions</field>
  31. <field name="arch" type="xml">
  32. <search string="Action">
  33. <field name="name" filter_domain="['|', ('name','ilike',self), ('type','ilike',self)]" string="Action"/>
  34. </search>
  35. </field>
  36. </record>
  37. <record id="ir_sequence_actions" model="ir.actions.act_window">
  38. <field name="name">Actions</field>
  39. <field name="type">ir.actions.act_window</field>
  40. <field name="res_model">ir.actions.actions</field>
  41. <field name="view_id" ref="action_view_tree"/>
  42. <field name="search_view_id" ref="action_view_search"/>
  43. </record>
  44. <menuitem id="next_id_6" name="Actions" parent="base.menu_custom" sequence="5"/>
  45. <menuitem action="ir_sequence_actions" id="menu_ir_sequence_actions" parent="next_id_6"/>
  46. <!-- ir.actions.report -->
  47. <record id="act_report_xml_view" model="ir.ui.view">
  48. <field name="name">ir.actions.report</field>
  49. <field name="model">ir.actions.report</field>
  50. <field name="arch" type="xml">
  51. <form string="Report">
  52. <field name="binding_model_id" invisible="1"/>
  53. <sheet>
  54. <div class="oe_button_box" name="button_box">
  55. <button name="create_action" string="Add in the 'Print' menu" type="object"
  56. attrs="{'invisible':[('binding_model_id','!=',False)]}" icon="fa-plus-square"
  57. help="Display an option on related documents to print this report" class="oe_stat_button"/>
  58. <button name="unlink_action" string="Remove from the 'Print' menu" type="object"
  59. attrs="{'invisible':[('binding_model_id','=',False)]}" icon="fa-minus-square"
  60. help="Remove the contextual action related to this report" class="oe_stat_button"/>
  61. <button name="associated_view" string="QWeb views" type="object"
  62. attrs="{'invisible':[('report_type', 'not in', ['qweb-pdf', 'qweb-html', 'qweb-text'])]}" icon='fa-code'
  63. class="oe_stat_button"/>
  64. </div>
  65. <group>
  66. <group>
  67. <field name="name"/>
  68. <field name="report_type"/>
  69. <field name="paperformat_id"
  70. attrs="{'invisible':[('report_type','not in',['qweb-pdf'])]}"/>
  71. </group>
  72. <group>
  73. <field name="model"/>
  74. <field name="report_name"/>
  75. <field name="print_report_name" />
  76. </group>
  77. </group>
  78. <notebook>
  79. <page name="security" string="Security">
  80. <field name="groups_id"/>
  81. </page>
  82. <page name='advanced' string="Advanced Properties">
  83. <group>
  84. <field name="attachment_use"/>
  85. <field name="attachment"/>
  86. </group>
  87. </page>
  88. </notebook>
  89. </sheet>
  90. </form>
  91. </field>
  92. </record>
  93. <record id="act_report_xml_view_tree" model="ir.ui.view">
  94. <field name="name">ir.actions.report.tree</field>
  95. <field name="model">ir.actions.report</field>
  96. <field name="arch" type="xml">
  97. <tree string="Report xml">
  98. <field name="name"/>
  99. <field name="model"/>
  100. <field name="type"/>
  101. <field name="report_name"/>
  102. <field name="report_type"/>
  103. <field name="attachment"/>
  104. </tree>
  105. </field>
  106. </record>
  107. <record id="act_report_xml_search_view" model="ir.ui.view">
  108. <field name="name">ir.actions.report.search</field>
  109. <field name="model">ir.actions.report</field>
  110. <field name="arch" type="xml">
  111. <search string="Report Xml">
  112. <field name="name"
  113. filter_domain="['|', '|', '|', '|', ('name','ilike',self), ('model','ilike',self), ('type','ilike',self), ('report_name','ilike',self), ('report_type','ilike',self)]"
  114. string="Report"/>
  115. <field name="model" filter_domain="[('model','=', self)]" string="Model"/>
  116. <group expand="0" string="Group By" colspan="4">
  117. <filter string="Report Type" name="report_type" domain="[]" context="{'group_by':'report_type'}"/>
  118. <filter string="Report Model" name="report_model" domain="[]" context="{'group_by':'model'}"/>
  119. </group>
  120. </search>
  121. </field>
  122. </record>
  123. <record id="ir_action_report" model="ir.actions.act_window">
  124. <field name="name">Reports</field>
  125. <field name="type">ir.actions.act_window</field>
  126. <field name="res_model">ir.actions.report</field>
  127. <field name="view_id" ref="act_report_xml_view_tree"/>
  128. <field name="search_view_id" ref="act_report_xml_search_view"/>
  129. </record>
  130. <menuitem action="ir_action_report" id="menu_ir_action_report" parent="base.next_id_6"/>
  131. <!-- ir.actions.act_window -->
  132. <record id="view_window_action_tree" model="ir.ui.view">
  133. <field name="name">ir.actions.windows.tree</field>
  134. <field name="model">ir.actions.act_window</field>
  135. <field name="arch" type="xml">
  136. <tree string="Open Window">
  137. <field name="name"/>
  138. <field name="res_model"/>
  139. <field name="view_id"/>
  140. <field name="domain"/>
  141. <field name="context"/>
  142. </tree>
  143. </field>
  144. </record>
  145. <record id="view_window_action_form" model="ir.ui.view">
  146. <field name="name">ir.actions.windows.form</field>
  147. <field name="model">ir.actions.act_window</field>
  148. <field name="arch" type="xml">
  149. <form string="Open a Window">
  150. <sheet>
  151. <group>
  152. <group name="main_details">
  153. <field name="name"/>
  154. <field name="xml_id" string="External ID"/>
  155. <field name="res_model" string="Object"/>
  156. </group>
  157. <group name="action_details">
  158. <field name="usage"/>
  159. <field name="type" readonly="1"/>
  160. <field name="target"/>
  161. </group>
  162. </group>
  163. <notebook>
  164. <page name="general_settings" string="General Settings">
  165. <group>
  166. <group name="views" string="Views">
  167. <field name="view_mode"/>
  168. <field name="view_id"/>
  169. <field name="search_view_id"/>
  170. </group>
  171. <group name="filters" string="Filters">
  172. <field name="domain"/>
  173. <field name="context"/>
  174. <field name="limit"/>
  175. <field name="filter"/>
  176. </group>
  177. </group>
  178. <group name="help" string="Help">
  179. <field colspan="2" name="help" nolabel="1" class="oe-bordered-editor"/>
  180. </group>
  181. <group name="views_tree" string="Views">
  182. <field colspan="2" name="view_ids" nolabel="1">
  183. <form string="Views">
  184. <group>
  185. <field name="sequence"/>
  186. <field name="view_mode"/>
  187. <field domain="[('type', '=', view_mode)]" name="view_id"/>
  188. </group>
  189. </form>
  190. <tree string="Views">
  191. <field name="sequence" widget="handle"/>
  192. <field name="view_mode"/>
  193. <field name="view_id"/>
  194. </tree>
  195. </field>
  196. </group>
  197. </page>
  198. <page string="Security" name="security">
  199. <field name="groups_id"/>
  200. </page>
  201. </notebook>
  202. </sheet>
  203. </form>
  204. </field>
  205. </record>
  206. <record id="view_window_action_search" model="ir.ui.view">
  207. <field name="name">ir.actions.windows.search</field>
  208. <field name="model">ir.actions.act_window</field>
  209. <field name="arch" type="xml">
  210. <search string="Open a Window">
  211. <field name="name" filter_domain="['|', ('name','ilike',self), ('res_model','ilike',self)]" string="Action"/>
  212. </search>
  213. </field>
  214. </record>
  215. <record id="ir_action_window" model="ir.actions.act_window">
  216. <field name="name">Window Actions</field>
  217. <field name="type">ir.actions.act_window</field>
  218. <field name="res_model">ir.actions.act_window</field>
  219. <field name="search_view_id" ref="view_window_action_search"/>
  220. </record>
  221. <record id="ir_action_window_view1" model="ir.actions.act_window.view">
  222. <field eval="1" name="sequence"/>
  223. <field name="view_mode">tree</field>
  224. <field name="view_id" ref="view_window_action_tree"/>
  225. <field name="act_window_id" ref="ir_action_window"/>
  226. </record>
  227. <record id="ir_action_window_view2" model="ir.actions.act_window.view">
  228. <field eval="2" name="sequence"/>
  229. <field name="view_mode">form</field>
  230. <field name="view_id" ref="view_window_action_form"/>
  231. <field name="act_window_id" ref="ir_action_window"/>
  232. </record>
  233. <menuitem action="ir_action_window" id="menu_ir_action_window" parent="base.next_id_6"/>
  234. <!-- ir.actions.server -->
  235. <record id="view_server_action_form" model="ir.ui.view">
  236. <field name="name">Server Action</field>
  237. <field name="model">ir.actions.server</field>
  238. <field name="arch" type="xml">
  239. <form string="Server Action">
  240. <header>
  241. <field name="binding_model_id" invisible="1"/>
  242. <button name="create_action" string="Create Contextual Action" type="object"
  243. class="btn-primary"
  244. attrs="{'invisible':[('binding_model_id','!=',False)]}"
  245. help="Display an option in the 'More' top-menu in order to run this action."/>
  246. <button name="unlink_action" string="Remove Contextual Action" type="object"
  247. attrs="{'invisible':[('binding_model_id','=',False)]}"
  248. help="Remove 'More' top-menu contextual action related to this action"/>
  249. <button name="run" string="Run" type="object"
  250. class="btn-primary"
  251. attrs="{'invisible':['|', ('model_id', '!=', %(base.model_ir_actions_server)s), ('state', '!=', 'code')]}"
  252. help="Run this action manually."/>
  253. </header>
  254. <sheet>
  255. <div class="oe_title">
  256. <label for="name"/>
  257. <h1><field name="name" placeholder="e.g. Update order quantity"/></h1>
  258. </div>
  259. <group name="action_wrapper">
  260. <group name="action_content">
  261. <field name="model_id" options="{'no_create': True}"/>
  262. <field name="model_name" invisible="1"/>
  263. </group>
  264. <group>
  265. <field name="state"/>
  266. <field name="type" invisible="1"/>
  267. <field name="crud_model_id"
  268. options="{'no_create': True}"
  269. attrs="{'invisible': [('state', '!=', 'object_create')], 'required': [('state', '=', 'object_create')]}"/>
  270. <field name="crud_model_name" invisible="1"/>
  271. <field name="link_field_id"
  272. domain="[('model_id', '=', model_id), ('relation', '=', crud_model_name),
  273. ('ttype', 'in', ['many2one', 'one2many', 'many2many'])]"
  274. options="{'no_create': True}"
  275. attrs="{'invisible': [('state', '!=', 'object_create')]}"
  276. context="{'default_model_id': model_id, 'default_relation': crud_model_name}"/>
  277. </group>
  278. </group>
  279. <notebook>
  280. <page string="Python Code" name='code'
  281. attrs="{'invisible': [('state', '!=', 'code')]}">
  282. <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."/>
  283. </page>
  284. <page string="Data to Write" name="page_object"
  285. attrs="{'invisible':[('state', 'not in', ['object_create', 'object_write'])]}">
  286. <p attrs="{'invisible': [('model_id', '!=', False)]}">
  287. Please set the Model to Create before choosing values
  288. </p>
  289. <field name="fields_lines">
  290. <tree string="Field Mappings" editable="bottom">
  291. <field name="col1"
  292. options="{'no_create': True}"
  293. domain="['|', ('model_id', '=', parent.crud_model_id), ('model_id', '=', parent.model_id)]"/>
  294. <field name="evaluation_type"/>
  295. <field name="resource_ref"
  296. options="{'hide_model': True, 'no_create': True}"
  297. attrs="{'readonly': [('evaluation_type', '!=', 'reference')]}"/>
  298. <field name="value"
  299. attrs="{'readonly': [('evaluation_type', '=', 'reference')]}"
  300. options="{'no_create': True}"
  301. force_save="1"/>
  302. </tree>
  303. </field>
  304. </page>
  305. <page name="security" string="Security">
  306. <field name="groups_id"/>
  307. </page>
  308. <page string="Actions" name="actions"
  309. attrs="{'invisible': [('state', '!=', 'multi')]}">
  310. <p class="oe_grey">
  311. If several child actions return an action, only the last one will be executed.
  312. This may happen when having server actions executing code that returns an action, or server actions returning a client action.
  313. </p>
  314. <field name="child_ids" domain="[('model_id', '=', model_id)]"/>
  315. </page>
  316. <page string="Help" name="help_info"
  317. attrs="{'invisible': [('state', '!=', 'code')]}">
  318. <div style="margin-top: 4px;">
  319. <h3>Help with Python expressions</h3>
  320. <p>Various fields may use Python code or Python expressions. The following variables can be used:</p>
  321. <ul>
  322. <li><code>env</code>: Odoo Environment on which the action is triggered</li>
  323. <li><code>model</code>: Odoo Model of the record on which the action is triggered; is a void recordset</li>
  324. <li><code>record</code>: record on which the action is triggered; may be be void</li>
  325. <li><code>records</code>: recordset of all records on which the action is triggered in multi mode; may be void</li>
  326. <li><code>time</code>, <code>datetime</code>, <code>dateutil</code>, <code>timezone</code>: useful Python libraries</li>
  327. <li><code>log(message, level='info')</code>: logging function to record debug information in <code>ir.logging</code> table</li>
  328. <li><code>UserError</code>: Warning Exception to use with <code>raise</code></li>
  329. <li><code>Command</code>: x2Many commands namespace</li>
  330. <li>To return an action, assign: <code>action = {...}</code></li>
  331. </ul>
  332. <div attrs="{'invisible': [('state', '!=', 'code')]}">
  333. <p>Example of Python code</p>
  334. <code style='white-space: pre-wrap'>
  335. partner_name = record.name + '_code' \n
  336. env['res.partner'].create({'name': partner_name})
  337. </code>
  338. </div>
  339. </div>
  340. </page>
  341. </notebook>
  342. </sheet>
  343. </form>
  344. </field>
  345. </record>
  346. <record id="view_server_action_tree" model="ir.ui.view">
  347. <field name="name">Server Actions</field>
  348. <field name="model">ir.actions.server</field>
  349. <field name="arch" type="xml">
  350. <tree string="Server Actions">
  351. <field name="sequence" widget="handle"/>
  352. <field name="name"/>
  353. <field name="state"/>
  354. <field name="model_id"/>
  355. <field name="usage"/>
  356. </tree>
  357. </field>
  358. </record>
  359. <record id="view_server_action_search" model="ir.ui.view">
  360. <field name="name">ir.actions.server.search</field>
  361. <field name="model">ir.actions.server</field>
  362. <field name="arch" type="xml">
  363. <search string="Server Actions">
  364. <field name="name" string="Server Action"/>
  365. <field name="model_id"/>
  366. <field name="state"/>
  367. <group expand="0" string="Group By" colspan="4" col="4">
  368. <filter string="Action Type" name="action_type" domain="[]" context="{'group_by':'state'}"/>
  369. <filter string="Model" name="model" domain="[]" context="{'group_by':'model_id'}"/>
  370. <filter string="Usage" name="usage" domain="[]" context="{'group_by':'usage'}"/>
  371. </group>
  372. </search>
  373. </field>
  374. </record>
  375. <record id="action_server_action" model="ir.actions.act_window">
  376. <field name="name">Server Actions</field>
  377. <field name="type">ir.actions.act_window</field>
  378. <field name="res_model">ir.actions.server</field>
  379. <field name="view_mode">tree,form</field>
  380. <field name="view_id" ref="view_server_action_tree"/>
  381. <field name="search_view_id" ref="view_server_action_search"/>
  382. <field name="context">{'key':'server_action'}</field>
  383. </record>
  384. <menuitem action="action_server_action" id="menu_server_action" parent="base.next_id_6"/>
  385. <!-- ir.actions.todo -->
  386. <record id="ir_actions_todo_tree" model="ir.ui.view">
  387. <field name="model">ir.actions.todo</field>
  388. <field name="name">Config Wizard Steps</field>
  389. <field name="arch" type="xml">
  390. <tree string="Config Wizard Steps">
  391. <field name="sequence" widget='handle'/>
  392. <field name="action_id"/>
  393. <field name="state" readonly="1"/>
  394. <button name="action_launch" states="open" string="Launch" type="object" icon="fa-cogs" help="Launch Configuration Wizard"/>
  395. <button name="action_open" states="done"
  396. string="Todo" type="object" help="Set as Todo"
  397. icon="fa-exchange"/>
  398. </tree>
  399. </field>
  400. </record>
  401. <record id="config_wizard_step_view_form" model="ir.ui.view">
  402. <field name="model">ir.actions.todo</field>
  403. <field name="name">Config Wizard Steps</field>
  404. <field name="arch" type="xml">
  405. <form string="Config Wizard Steps">
  406. <header>
  407. <button name="action_launch"
  408. states="open" string="Launch"
  409. type="object" icon="fa-cogs" class="oe_highlight"
  410. help="Launch Configuration Wizard"/>
  411. <button name="action_open" states="done"
  412. string="Set as Todo" type="object"
  413. icon="fa-exchange" class="oe_highlight"/>
  414. <field name="state" widget="statusbar" statusbar_visible="open,done" nolabel="1" readonly="1" />
  415. </header>
  416. <sheet>
  417. <group col="4">
  418. <field name="action_id"/>
  419. <field name="sequence"/>
  420. </group>
  421. </sheet>
  422. </form>
  423. </field>
  424. </record>
  425. <record id="config_wizard_step_view_search" model="ir.ui.view">
  426. <field name="model">ir.actions.todo</field>
  427. <field name="name">ir.actions.todo.select</field>
  428. <field name="arch" type="xml">
  429. <search string="Search Actions">
  430. <filter string="To Do" name="todo" domain=" [('state','=','open')]" help="Wizards to be Launched"/>
  431. <field name="action_id"/>
  432. <field name="state"/>
  433. </search>
  434. </field>
  435. </record>
  436. <record id="act_ir_actions_todo_form" model="ir.actions.act_window">
  437. <field name="name">Configuration Wizards</field>
  438. <field name="res_model">ir.actions.todo</field>
  439. <field name="view_id" ref="ir_actions_todo_tree"/>
  440. <field name="help">The configuration wizards are used to help you configure a new instance of Odoo. They are launched during the installation of new modules, but you can choose to restart some wizards manually from this menu.</field>
  441. </record>
  442. <menuitem id="menu_ir_actions_todo_form" action="act_ir_actions_todo_form" parent="base.next_id_6"/>
  443. <record id="action_run_ir_action_todo" model="ir.actions.server">
  444. <field name="name">Config: Run Remaining Action Todo</field>
  445. <field name="type">ir.actions.server</field>
  446. <field name="model_id" ref="model_res_config"/>
  447. <field name="state">code</field>
  448. <field name="code">
  449. config = model.next() or {}
  450. if config.get('type') not in ('ir.actions.act_window_close',):
  451. action = config
  452. </field>
  453. </record>
  454. </odoo>