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.

88 lines
3.7 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="report_survey_answers_document">
  4. <t t-call="web.internal_layout">
  5. <t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
  6. <div class="page">
  7. <div class="oe_structure"/>
  8. <div class="row mt32 mb32" style="display: inherit;">
  9. <h3 class="text-center"><t t-esc="doc.survey_id.title"/></h3>
  10. <t t-set="questions" t-value="doc.user_input_line_ids.mapped('question_id')"/>
  11. <!-- <h3 class="text-center"><t t-esc="doc."/></h3> -->
  12. <t t-foreach="questions" t-as="qs">
  13. <t t-if="qs.matrix_subtype == 'custom'">
  14. <h4 class="text-center mt16 mb16" t-field="qs.question"/>
  15. <table class="table" style="width:100%;">
  16. <thead>
  17. <tr style="width:100%;text-align: center">
  18. <th style="text-align: center">#</th>
  19. <t t-foreach="qs.labels_ids" t-as="lb">
  20. <th style="text-align: center"> <span t-field="lb.value"/></th>
  21. </t>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. <t t-foreach="qs.labels_ids_2" t-as="lb2">
  26. <tr style="text-align: center">
  27. <td style="text-align: center"><strong t-field="lb2.value"></strong></td>
  28. <t t-foreach="qs.labels_ids" t-as="lb">
  29. <t t-set="flag" t-value="false"/>
  30. <t t-foreach="doc.user_input_line_ids" t-as="ans">
  31. <t t-if="ans.value_suggested_row.id == lb2.id">
  32. <t t-if="ans.value_suggested.id == lb.id">
  33. <td class="text-center">
  34. <t t-if="ans.answer_type == 'text'">
  35. <span t-field="ans.value_text"/>
  36. </t>
  37. <t t-if="ans.answer_type == 'number'">
  38. <span t-field="ans.value_number"/>
  39. </t>
  40. <t t-if="ans.answer_type == 'free_text'">
  41. <span t-field="ans.value_free_text"/>
  42. </t>
  43. <t t-if="ans.answer_type == 'suggestion'">
  44. <span class="fa fa-check"/>
  45. </t>
  46. <t t-if="ans.answer_type == 'dropdown'">
  47. <span t-field="ans.value_id"/>
  48. </t>
  49. </td>
  50. <t t-set="flag" t-value="true"/>
  51. </t>
  52. </t>
  53. </t>
  54. <t t-if="not flag">
  55. <td style="text-align: center">
  56. </td>
  57. </t>
  58. </t>
  59. </tr>
  60. </t>
  61. </tbody>
  62. </table>
  63. </t>
  64. </t>
  65. </div>
  66. </div>
  67. </t>
  68. </template>
  69. <template id="report_survey_answers">
  70. <t t-call="web.html_container">
  71. <t t-foreach="docs" t-as="doc">
  72. <t t-call="survey_custom_matrix.report_survey_answers_document"/>
  73. </t>
  74. </t>
  75. </template>
  76. <report
  77. id="action_view_pdf_answers"
  78. string="Answers"
  79. model="survey.user_input"
  80. report_type="qweb-pdf"
  81. file="survey_custom_matrix.report_survey_answers"
  82. name="survey_custom_matrix.report_survey_answers"
  83. print_report_name="'answer - %s' % (object.survey_id.title)"/>
  84. </odoo>