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.

147 lines
8.2 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" type="object" string="Run" class="oe_read_only oe_highlight" icon="fa-play-circle" attrs="{'invisible': [('active','=', False)]}"/>
  9. </header>
  10. <sheet>
  11. <div class="oe_button_box" name="button_box">
  12. <button name="%(action_attachment_queue_related)d" type="action" class="oe_stat_button" icon="fa-thumbs-o-down" context="{'search_default_failed': 1}">
  13. <div class="o_field_widget o_stat_info">
  14. <span class="o_stat_value">
  15. <field name="count_attachment_failed" widget="statinfo" nolabel="1"/>
  16. </span>
  17. <span class="o_stat_text">Fail</span>
  18. </div>
  19. </button>
  20. <button name="%(action_attachment_queue_related)d" type="action" class="oe_stat_button" icon="fa-spinner" context="{'search_default_pending': 1}">
  21. <div class="o_field_widget o_stat_info">
  22. <span class="o_stat_value">
  23. <field name="count_attachment_pending" widget="statinfo" nolabel="1"/>
  24. </span>
  25. <span class="o_stat_text">Pending</span>
  26. </div>
  27. </button>
  28. <button name="%(action_attachment_queue_related)d" type="action" class="oe_stat_button" icon="fa-thumbs-o-up" context="{'search_default_done': 1}">
  29. <div class="o_field_widget o_stat_info">
  30. <span class="o_stat_value">
  31. <field name="count_attachment_done" widget="statinfo" nolabel="1"/>
  32. </span>
  33. <span class="o_stat_text">Success</span>
  34. </div>
  35. </button>
  36. <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
  37. <field
  38. name="active"
  39. widget="boolean_button"
  40. options="{'terminology': {
  41. 'string_true': 'Enabled',
  42. 'hover_true': &quot;Disable&quot;,
  43. 'string_false': 'Disabled',
  44. 'hover_false': &quot;Enable&quot;,
  45. }}"
  46. />
  47. </button>
  48. </div>
  49. <field name="method_type" invisible="1"/>
  50. <div class="oe_title">
  51. <label class="oe_edit_only" for="name" string="Name"/>
  52. <h1>
  53. <field name="name" class="oe_inline"/>
  54. </h1>
  55. <field name="create_date" invisible="1" />
  56. <field name="method_type" widget="radio" options="{'horizontal': true}" attrs="{'readonly':[('create_date', '!=', False)]}"/>
  57. </div>
  58. <group string="Storage Location" class="col-12 col-lg-6">
  59. <field name="backend_id"/>
  60. <field name="filepath"/>
  61. <field name="pattern" attrs="{'invisible':[('method_type','!=','import')]}"/>
  62. </group>
  63. <group name="action" string="Importation" attrs="{'invisible':[('method_type','!=','import')]}" class="col-12 col-lg-6">
  64. <field name="avoid_duplicated_files" />
  65. <field name="after_import" />
  66. <field name="move_path" colspan="4" attrs="{'invisible':[('after_import','!=','move'), ('after_import','!=','move_rename')]}"/>
  67. <field name="new_name" colspan="4" attrs="{'invisible': [('after_import','!=','rename'), ('after_import','!=','move_rename')]}"/>
  68. <field name="file_type"/>
  69. </group>
  70. <group string="Notification">
  71. <field name="failure_emails"/>
  72. </group>
  73. </sheet>
  74. </form>
  75. </field>
  76. </record>
  77. <record id="view_attachment_task_tree" model="ir.ui.view">
  78. <field name="model">attachment.synchronize.task</field>
  79. <field name="arch" type="xml">
  80. <tree string="Tasks" decoration-muted="active == False">
  81. <field name="name" select="1"/>
  82. <field name="backend_id"/>
  83. <field name="filepath"/>
  84. <field name="active" invisible="1"/>
  85. <button name="run" type="object" string="Run" icon="fa-play-circle"/>
  86. <field name="count_attachment_failed" string=" "/>
  87. <button name="%(action_attachment_queue_related)d" type="action" icon="fa-thumbs-o-down" context="{'search_default_failed': 1}"/>
  88. <field name="count_attachment_pending" string=" "/>
  89. <button name="%(action_attachment_queue_related)d" type="action" icon="fa-spinner" context="{'search_default_pending': 1}"/>
  90. <field name="count_attachment_done" string=" "/>
  91. <button name="%(action_attachment_queue_related)d" type="action" icon="fa-thumbs-o-up" context="{'search_default_done': 1}"/>
  92. <button name="button_duplicate_record" type="object" string="Copy" icon="fa-clone" invisible="not context.get('show_duplicate_button')"/>
  93. <button name="toggle_active" type="object" string="Active/Inactive" icon="fa-archive" invisible="not context.get('show_toggle_active_button')"/>
  94. </tree>
  95. </field>
  96. </record>
  97. <record id="view_attachment_task_search" model="ir.ui.view">
  98. <field name="model">attachment.synchronize.task</field>
  99. <field name="arch" type="xml">
  100. <search string="Attachments">
  101. <field name="name" filter_domain="['|', ('name','ilike',self), ('datas_fname','ilike',self)]" string="Attachment Task"/>
  102. <field name="create_date"/>
  103. <filter string="Backend" name="backend" context="{'group_by':'backend_id'}"/>
  104. </search>
  105. </field>
  106. </record>
  107. <!-- Attachments Import Tasks Menu -->
  108. <record id="action_attachment_import_task" model="ir.actions.act_window">
  109. <field name="name">Attachments Import Tasks</field>
  110. <field name="type">ir.actions.act_window</field>
  111. <field name="res_model">attachment.synchronize.task</field>
  112. <field name="view_type">form</field>
  113. <field name="view_mode">tree,form</field>
  114. <field name="view_id" eval="False"/>
  115. <field name="search_view_id" ref="view_attachment_task_search"/>
  116. <field name="domain">[('method_type', '=', 'import')]</field>
  117. <field name="context">{'default_method_type': 'import', "active_test": False}</field>
  118. </record>
  119. <menuitem id="menu_attachment_import_task"
  120. parent="base.next_id_9"
  121. sequence="21"
  122. action="action_attachment_import_task"/>
  123. <!-- Attachments Export Tasks Menu -->
  124. <record id="action_attachment_export_task" model="ir.actions.act_window">
  125. <field name="name">Attachments Export Tasks</field>
  126. <field name="type">ir.actions.act_window</field>
  127. <field name="res_model">attachment.synchronize.task</field>
  128. <field name="view_type">form</field>
  129. <field name="view_mode">tree,form</field>
  130. <field name="view_id" eval="False"/>
  131. <field name="search_view_id" ref="view_attachment_task_search"/>
  132. <field name="domain">[('method_type', '=', 'export')]</field>
  133. <field name="context">{'default_method_type': 'export', "active_test": False}</field>
  134. </record>
  135. <menuitem id="menu_attachment_export_task"
  136. parent="base.next_id_9"
  137. sequence="22"
  138. action="action_attachment_export_task"/>
  139. </odoo>