Odoo modules related to surveys
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.

173 lines
6.9 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- survey views and actions -->
  4. <record id="survey_survey_form" model="ir.ui.view">
  5. <field name="name">survey_template survey.survey form</field>
  6. <field name="model">survey.survey</field>
  7. <field name="inherit_id" ref="survey.survey_form"/>
  8. <field name="priority">20</field>
  9. <field name="arch" type="xml">
  10. <field name="is_closed" position="after">
  11. <field name="is_template" invisible="1"/>
  12. </field>
  13. <!-- Hide send button and stage on templates -->
  14. <button name="action_send_survey" position="attributes">
  15. <attribute name="attrs">{'invisible': [('is_template', '=', True)]}</attribute>
  16. </button>
  17. <field name="stage_id" position="attributes">
  18. <attribute name="attrs">{'invisible': [('is_template', '=', True)]}</attribute>
  19. </field>
  20. <div name="button_box" position="after">
  21. <h2 class="badge-pill badge-warning float-right" attrs="{'invisible': [('is_template', '=', False)]}">Ce sondage est un modèle</h2>
  22. </div>
  23. </field>
  24. </record>
  25. <record id="survey_survey_tree" model="ir.ui.view">
  26. <field name="name">survey_template survey.survey tree</field>
  27. <field name="model">survey.survey</field>
  28. <field name="inherit_id" ref="survey.survey_tree"/>
  29. <field name="priority">20</field>
  30. <field name="arch" type="xml">
  31. <tree position="attributes">
  32. <attribute name="decoration-warning">is_template</attribute>
  33. </tree>
  34. <tree position="inside">
  35. <field name="is_template" invisible="1"/>
  36. </tree>
  37. </field>
  38. </record>
  39. <record id="survey_survey_kanban" model="ir.ui.view">
  40. <field name="name">survey_template survey.survey kanban</field>
  41. <field name="model">survey.survey</field>
  42. <field name="inherit_id" ref="survey.survey_kanban"/>
  43. <field name="priority">20</field>
  44. <field name="arch" type="xml">
  45. <xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
  46. <div t-if="record.is_template.raw_value" class="badge-pill badge-warning">Modèle</div>
  47. </xpath>
  48. </field>
  49. </record>
  50. <record model="ir.actions.act_window" id="survey.action_survey_form">
  51. <field name="domain">[('is_template','=',False)]</field>
  52. </record>
  53. <!-- survey template views and actions -->
  54. <record id="survey_survey_template_tree" model="ir.ui.view">
  55. <field name="name">survey_template survey.survey template tree</field>
  56. <field name="model">survey.survey</field>
  57. <field name="priority">20</field>
  58. <field name="arch" type="xml">
  59. <tree decoration-warning="is_template">
  60. <field name="active" invisible="1"/>
  61. <field name="is_template" invisible="1"/>
  62. <field name="title"/>
  63. </tree>
  64. </field>
  65. </record>
  66. <record id="survey_survey_template_kanban" model="ir.ui.view">
  67. <field name="name">survey_template survey.survey template kanban</field>
  68. <field name="model">survey.survey</field>
  69. <field name="priority">20</field>
  70. <field name="arch" type="xml">
  71. <kanban>
  72. <field name="designed"/>
  73. <field name="title"/>
  74. <field name="is_template"/>
  75. <field name="color"/>
  76. <templates>
  77. <div t-name="kanban-box" t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
  78. <div class="o_dropdown_kanban dropdown" t-if="widget.editable">
  79. <a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" data-display="static" href="#" aria-label="Dropdown menu" title="Dropdown menu">
  80. <span class="fa fa-ellipsis-v"/>
  81. </a>
  82. <div class="dropdown-menu" role="menu">
  83. <a role="menuitem" type="edit" class="dropdown-item">Modifieer le modèle</a>
  84. <a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Supprimer ce modèle</a>
  85. <div role="separator" class="dropdown-divider"/>
  86. <div role="separator" class="dropdown-item-text">Color</div>
  87. <ul class="oe_kanban_colorpicker" data-field="color"/>
  88. </div>
  89. </div>
  90. <div class="o_kanban_record_top">
  91. <h4 class="o_kanban_record_title mb4 d-block"><field name="title"/></h4>
  92. </div>
  93. <div class="o_kanban_record_bottom">
  94. <div class="oe_kanban_bottom_left">
  95. <div t-if="record.is_template.raw_value" class="badge-pill badge-warning">Modèle</div>
  96. </div>
  97. <div class="oe_kanban_bottom_right">
  98. <field name="activity_ids" widget="kanban_activity"/>
  99. </div>
  100. </div>
  101. </div>
  102. </templates>
  103. </kanban>
  104. </field>
  105. </record>
  106. <record id="survey_survey_template_act_window" model="ir.actions.act_window">
  107. <field name="name">Modèles de sondages</field>
  108. <field name="res_model">survey.survey</field>
  109. <field name="view_type">form</field>
  110. <field name="view_mode">kanban,tree,form</field>
  111. <field name="domain">[('is_template','=',True)]</field>
  112. <field name="context">{'default_is_template':True}</field>
  113. <field name="help" type="html">
  114. <p class="o_view_nocontent_smiling_face">
  115. Créez un nouveau modèle de sondage.
  116. </p>
  117. </field>
  118. </record>
  119. <record id="survey_survey_template_act_window_view_kanban" model="ir.actions.act_window.view">
  120. <field name="sequence" eval="1"/>
  121. <field name="view_mode">kanban</field>
  122. <field name="view_id" ref="survey_survey_template_kanban"/>
  123. <field name="act_window_id" ref="survey_survey_template_act_window"/>
  124. </record>
  125. <record id="survey_survey_template_act_window_view_tree" model="ir.actions.act_window.view">
  126. <field name="sequence" eval="2"/>
  127. <field name="view_mode">tree</field>
  128. <field name="view_id" ref="survey_survey_template_tree"/>
  129. <field name="act_window_id" ref="survey_survey_template_act_window"/>
  130. </record>
  131. <!-- survey config menus rearrange -->
  132. <record id="survey.menu_surveys_configuration" model="ir.ui.menu">
  133. <field name="groups_id" eval="[(6,0,[ref('survey.group_survey_manager')])]"/>
  134. </record>
  135. <menuitem
  136. id="survey_survey_template_menu"
  137. name="Modèles"
  138. action="survey_survey_template_act_window"
  139. parent="survey.menu_surveys_configuration"
  140. sequence="0"
  141. groups="survey.group_survey_manager"/>
  142. <record id="survey.menu_survey_page_form1" model="ir.ui.menu">
  143. <field name="groups_id" eval="[(4, ref('base.group_no_one'))]"/>
  144. </record>
  145. <record id="survey.menu_survey_question_form1" model="ir.ui.menu">
  146. <field name="groups_id" eval="[(4, ref('base.group_no_one'))]"/>
  147. </record>
  148. <record id="survey.menu_survey_label_form1" model="ir.ui.menu">
  149. <field name="groups_id" eval="[(4, ref('base.group_no_one'))]"/>
  150. </record>
  151. <record id="survey.menu_survey_response_line_form" model="ir.ui.menu">
  152. <field name="groups_id" eval="[(4, ref('base.group_no_one'))]"/>
  153. </record>
  154. </odoo>