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.

166 lines
8.3 KiB

5 years ago
  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-check-square">
  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" colspan="4">
  30. <label class="oe_edit_only" for="name" string="Name"/>
  31. <h1>
  32. <field name="name" class="oe_inline"/>
  33. </h1>
  34. </div>
  35. <group class="col-12 col-lg-6">
  36. <field name="method_type"/>
  37. <field name="backend_id"/>
  38. <field name="filepath"/>
  39. <field name="pattern" attrs="{'invisible':[('method_type','!=','import')]}"/>
  40. </group>
  41. <group name="action" string="Importation Settings" attrs="{'invisible':[('method_type','!=','import')]}" class="col-12 col-lg-6">
  42. <field name="avoid_duplicated_files" />
  43. <field name="after_import" />
  44. <field name="move_path" colspan="4" attrs="{'invisible':[('after_import','!=','move'), ('after_import','!=','move_rename')]}"/>
  45. <field name="new_name" colspan="4" attrs="{'invisible': [('after_import','!=','rename'), ('after_import','!=','move_rename')]}"/>
  46. </group>
  47. <group string="Attachments">
  48. <group>
  49. <field name="file_type" attrs="{'invisible':[('method_type','!=','import')]}" />
  50. <field name="emails" attrs="{'invisible':[('method_type','!=','import')]}" />
  51. </group>
  52. <field name="attachment_ids" domain="[('task_id', '=', id)]" nolabel="1" attrs="{'invisible':[('method_type','!=','export')]}"/>
  53. </group>
  54. </sheet>
  55. </form>
  56. </field>
  57. </record>
  58. <record id="view_attachment_import_task_tree" model="ir.ui.view">
  59. <field name="model">attachment.synchronize.task</field>
  60. <field name="arch" type="xml">
  61. <tree string="Tasks" decoration-muted="enabled == False">
  62. <field name="name" select="1"/>
  63. <field name="pattern"/>
  64. <field name="filepath"/>
  65. <field name="move_path"/>
  66. <field name="after_import"/>
  67. <field name="backend_id"/>
  68. <field name="enabled" invisible="1"/>
  69. <button name="button_duplicate_record" type="object" title="Copy" class="fa fa-clone"/>
  70. <button name="button_toogle_enabled" type="object" title="Enable" class="fa fa-check-square"/>
  71. </tree>
  72. </field>
  73. </record>
  74. <record id="view_attachment_export_task_tree" model="ir.ui.view">
  75. <field name="model">attachment.synchronize.task</field>
  76. <field name="arch" type="xml">
  77. <tree string="Tasks" decoration-muted="enabled == False">
  78. <field name="name" select="1"/>
  79. <field name="filepath"/>
  80. <field name="backend_id"/>
  81. <field name="enabled" invisible="1"/>
  82. <button name="button_duplicate_record" type="object" title="Copy" class="fa fa-clone"/>
  83. <button name="button_toogle_enabled" type="object" title="Enable" class="fa fa-check-square"/>
  84. </tree>
  85. </field>
  86. </record>
  87. <record id="view_attachment_task_search" model="ir.ui.view">
  88. <field name="model">attachment.synchronize.task</field>
  89. <field name="arch" type="xml">
  90. <search string="Attachments">
  91. <field name="name" filter_domain="['|', ('name','ilike',self), ('datas_fname','ilike',self)]" string="Attachment Task"/>
  92. <field name="create_date"/>
  93. <filter string="Backend" name="backend" context="{'group_by':'backend_id'}"/>
  94. </search>
  95. </field>
  96. </record>
  97. <!-- Attachments Import Tasks Menu -->
  98. <record id="action_attachment_import_task" model="ir.actions.act_window">
  99. <field name="name">Attachments Import Tasks</field>
  100. <field name="type">ir.actions.act_window</field>
  101. <field name="res_model">attachment.synchronize.task</field>
  102. <field name="view_type">form</field>
  103. <field name="view_mode">tree,form</field>
  104. <field name="view_id" eval="False"/>
  105. <field name="search_view_id" ref="view_attachment_task_search"/>
  106. <field name="domain">[('method_type', '=', 'import')]</field>
  107. <field name="context">{'default_method_type': 'import'}</field>
  108. </record>
  109. <record id="act_open_attachment_task_view_tree" model="ir.actions.act_window.view">
  110. <field eval="10" name="sequence"/>
  111. <field name="view_mode">tree</field>
  112. <field name="view_id" ref="view_attachment_import_task_tree"/>
  113. <field name="act_window_id" ref="action_attachment_import_task"/>
  114. </record>
  115. <record id="act_open_attachment_task_view_form" model="ir.actions.act_window.view">
  116. <field eval="10" name="sequence"/>
  117. <field name="view_mode">form</field>
  118. <field name="view_id" ref="view_attachment_task_form"/>
  119. <field name="act_window_id" ref="action_attachment_import_task"/>
  120. </record>
  121. <menuitem id="menu_attachment_import_task"
  122. parent="base.next_id_9"
  123. sequence="21"
  124. action="action_attachment_import_task"/>
  125. <!-- Attachments Export Tasks Menu -->
  126. <record id="action_attachment_export_task" model="ir.actions.act_window">
  127. <field name="name">Attachments Export Tasks</field>
  128. <field name="type">ir.actions.act_window</field>
  129. <field name="res_model">attachment.synchronize.task</field>
  130. <field name="view_type">form</field>
  131. <field name="view_mode">tree,form</field>
  132. <field name="view_id" eval="False"/>
  133. <field name="search_view_id" ref="view_attachment_task_search"/>
  134. <field name="domain">[('method_type', '=', 'export')]</field>
  135. <field name="context">{'default_method_type': 'export'}</field>
  136. </record>
  137. <record id="act_open_attachment_task_view_tree" model="ir.actions.act_window.view">
  138. <field eval="10" name="sequence"/>
  139. <field name="view_mode">tree</field>
  140. <field name="view_id" ref="view_attachment_export_task_tree"/>
  141. <field name="act_window_id" ref="action_attachment_export_task"/>
  142. </record>
  143. <record id="act_open_attachment_task_view_form" model="ir.actions.act_window.view">
  144. <field eval="10" name="sequence"/>
  145. <field name="view_mode">form</field>
  146. <field name="view_id" ref="view_attachment_task_form"/>
  147. <field name="act_window_id" ref="action_attachment_export_task"/>
  148. </record>
  149. <menuitem id="menu_attachment_export_task"
  150. parent="base.next_id_9"
  151. sequence="22"
  152. action="action_attachment_export_task"/>
  153. </odoo>