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.

177 lines
8.9 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="view_attachment_task_form" model="ir.ui.view">
  4. <field name="model">attachment.synchronize.task</field>
  5. <field name="arch" type="xml">
  6. <form>
  7. <header>
  8. <button name="run_import" type="object" string="Run Import" class="oe_read_only oe_highlight" icon="fa-play-circle" attrs="{'invisible': ['|', ('method_type', '!=', 'import'), ('enabled','=', False)]}"/>
  9. </header>
  10. <header>
  11. <button name="run_export" type="object" string="Run Export" class="oe_read_only oe_highlight" icon="fa-play-circle" attrs="{'invisible': ['|', ('method_type', '!=', 'export'), ('enabled','=', False)]}"/>
  12. </header>
  13. <sheet>
  14. <div class="oe_button_box" name="button_box">
  15. <button name="button_toogle_enabled" type="object" class="oe_stat_button" icon="fa-archive">
  16. <field
  17. name="enabled"
  18. widget="boolean_button"
  19. options="{'terminology': {
  20. 'string_true': 'Enabled',
  21. 'hover_true': &quot;Disable&quot;,
  22. 'string_false': 'Disabled',
  23. 'hover_false': &quot;Enable&quot;,
  24. }}"
  25. />
  26. </button>
  27. </div>
  28. <field name="method_type" invisible="1"/>
  29. <div class="oe_title">
  30. <label class="oe_edit_only" for="name" string="Name"/>
  31. <h1>
  32. <field name="name" class="oe_inline"/>
  33. </h1>
  34. <field name="create_date" invisible="1" />
  35. <field name="method_type" widget="radio" options="{'horizontal': true}" attrs="{'readonly':[('create_date', '!=', False)]}"/>
  36. </div>
  37. <group string="Storage Location" class="col-12 col-lg-6">
  38. <field name="backend_id"/>
  39. <field name="filepath"/>
  40. <field name="pattern" attrs="{'invisible':[('method_type','!=','import')]}"/>
  41. </group>
  42. <group name="action" string="Importation" attrs="{'invisible':[('method_type','!=','import')]}" class="col-12 col-lg-6">
  43. <field name="avoid_duplicated_files" />
  44. <field name="after_import" />
  45. <field name="move_path" colspan="4" attrs="{'invisible':[('after_import','!=','move'), ('after_import','!=','move_rename')]}"/>
  46. <field name="new_name" colspan="4" attrs="{'invisible': [('after_import','!=','rename'), ('after_import','!=','move_rename')]}"/>
  47. </group>
  48. <group string="Attachments">
  49. <group>
  50. <field name="file_type" attrs="{'invisible':[('method_type','!=','import')]}" />
  51. <field name="failure_emails" />
  52. </group>
  53. <field name="attachment_ids" domain="[('task_id', '=', id)]" nolabel="1" attrs="{'invisible':[('method_type','!=','export')]}">
  54. <tree>
  55. <field name="name"/>
  56. <field name="datas_fname"/>
  57. <field name="file_type"/>
  58. <field name="storage_backend_id"/>
  59. <field name="type"/>
  60. <field name="create_date"/>
  61. <field name="state"/>
  62. </tree>
  63. </field>
  64. </group>
  65. </sheet>
  66. </form>
  67. </field>
  68. </record>
  69. <record id="view_attachment_import_task_tree" model="ir.ui.view">
  70. <field name="model">attachment.synchronize.task</field>
  71. <field name="arch" type="xml">
  72. <tree string="Tasks" decoration-muted="enabled == False">
  73. <field name="name" select="1"/>
  74. <field name="backend_id"/>
  75. <field name="filepath"/>
  76. <field name="pattern"/>
  77. <field name="after_import"/>
  78. <field name="move_path"/>
  79. <field name="enabled" invisible="1"/>
  80. <button name="button_duplicate_record" type="object" string="Copy" icon="fa-clone"/>
  81. <button name="button_toogle_enabled" type="object" string="Enable" icon="fa-archive"/>
  82. </tree>
  83. </field>
  84. </record>
  85. <record id="view_attachment_export_task_tree" model="ir.ui.view">
  86. <field name="model">attachment.synchronize.task</field>
  87. <field name="arch" type="xml">
  88. <tree string="Tasks" decoration-muted="enabled == False">
  89. <field name="name" select="1"/>
  90. <field name="backend_id"/>
  91. <field name="filepath"/>
  92. <field name="enabled" invisible="1"/>
  93. <button name="button_duplicate_record" type="object" string="Copy" icon="fa-clone"/>
  94. <button name="button_toogle_enabled" type="object" string="Enable" icon="fa-archive"/>
  95. </tree>
  96. </field>
  97. </record>
  98. <record id="view_attachment_task_search" model="ir.ui.view">
  99. <field name="model">attachment.synchronize.task</field>
  100. <field name="arch" type="xml">
  101. <search string="Attachments">
  102. <field name="name" filter_domain="['|', ('name','ilike',self), ('datas_fname','ilike',self)]" string="Attachment Task"/>
  103. <field name="create_date"/>
  104. <filter string="Backend" name="backend" context="{'group_by':'backend_id'}"/>
  105. </search>
  106. </field>
  107. </record>
  108. <!-- Attachments Import Tasks Menu -->
  109. <record id="action_attachment_import_task" model="ir.actions.act_window">
  110. <field name="name">Attachments Import Tasks</field>
  111. <field name="type">ir.actions.act_window</field>
  112. <field name="res_model">attachment.synchronize.task</field>
  113. <field name="view_type">form</field>
  114. <field name="view_mode">tree,form</field>
  115. <field name="view_id" eval="False"/>
  116. <field name="search_view_id" ref="view_attachment_task_search"/>
  117. <field name="domain">[('method_type', '=', 'import')]</field>
  118. <field name="context">{'default_method_type': 'import'}</field>
  119. </record>
  120. <record id="act_open_attachment_import_task_view_tree" model="ir.actions.act_window.view">
  121. <field eval="10" name="sequence"/>
  122. <field name="view_mode">tree</field>
  123. <field name="view_id" ref="view_attachment_import_task_tree"/>
  124. <field name="act_window_id" ref="action_attachment_import_task"/>
  125. </record>
  126. <record id="act_open_attachment_import_task_view_form" model="ir.actions.act_window.view">
  127. <field eval="10" name="sequence"/>
  128. <field name="view_mode">form</field>
  129. <field name="view_id" ref="view_attachment_task_form"/>
  130. <field name="act_window_id" ref="action_attachment_import_task"/>
  131. </record>
  132. <menuitem id="menu_attachment_import_task"
  133. parent="base.next_id_9"
  134. sequence="21"
  135. action="action_attachment_import_task"/>
  136. <!-- Attachments Export Tasks Menu -->
  137. <record id="action_attachment_export_task" model="ir.actions.act_window">
  138. <field name="name">Attachments Export Tasks</field>
  139. <field name="type">ir.actions.act_window</field>
  140. <field name="res_model">attachment.synchronize.task</field>
  141. <field name="view_type">form</field>
  142. <field name="view_mode">tree,form</field>
  143. <field name="view_id" eval="False"/>
  144. <field name="search_view_id" ref="view_attachment_task_search"/>
  145. <field name="domain">[('method_type', '=', 'export')]</field>
  146. <field name="context">{'default_method_type': 'export'}</field>
  147. </record>
  148. <record id="act_open_attachment_export_task_view_tree" model="ir.actions.act_window.view">
  149. <field eval="10" name="sequence"/>
  150. <field name="view_mode">tree</field>
  151. <field name="view_id" ref="view_attachment_export_task_tree"/>
  152. <field name="act_window_id" ref="action_attachment_export_task"/>
  153. </record>
  154. <record id="act_open_attachment_export_task_view_form" model="ir.actions.act_window.view">
  155. <field eval="10" name="sequence"/>
  156. <field name="view_mode">form</field>
  157. <field name="view_id" ref="view_attachment_task_form"/>
  158. <field name="act_window_id" ref="action_attachment_export_task"/>
  159. </record>
  160. <menuitem id="menu_attachment_export_task"
  161. parent="base.next_id_9"
  162. sequence="22"
  163. action="action_attachment_export_task"/>
  164. </odoo>