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.

53 lines
2.6 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="matrix" inherit_id="survey.matrix">
  4. <xpath expr="//table" position="replace">
  5. <table class="table table-hover">
  6. <thead>
  7. <tr>
  8. <th></th>
  9. <th t-foreach="question.labels_ids" t-as="col_label"><span t-field="col_label.value"/></th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. <tr t-foreach="question.labels_ids_2" t-as="row_label">
  14. <th><span t-field="row_label.value"/></th>
  15. <td t-foreach="question.labels_ids" t-as="col_label">
  16. <input t-if="question.matrix_subtype == 'simple'" type="radio" t-att-name="'%s_%s' % (prefix, row_label.id)" t-att-value='col_label.id'/>
  17. <t t-if="question.matrix_subtype == 'custom_row'">
  18. <t t-if="col_label.type == 'textbox'">
  19. <input type="text" class="form-control" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  20. </t>
  21. <t t-if="col_label.type == 'free_text'">
  22. <textarea class="form-control" rows="3" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"></textarea>
  23. </t>
  24. <t t-if="col_label.type == 'numerical_box'">
  25. <input type="number" step="any" class="form-control" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  26. </t>
  27. <t t-if="col_label.type == 'date'">
  28. <div class='input-group date'>
  29. <input type="text" date="true" class="form-control date" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  30. </div>
  31. </t>
  32. <t t-if="col_label.type == 'dropdown'">
  33. <select t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)" class="form-control" id="seldpbox1">
  34. <option></option>
  35. <t t-foreach="col_label.dpvalues" t-as="dpv">
  36. <option t-att-value="dpv.id"><t t-esc="dpv.name"/></option>
  37. </t>
  38. </select>
  39. </t>
  40. <t t-if="col_label.type == 'checkbox'">
  41. <input type="checkbox" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)" t-att-value='col_label.id'/>
  42. </t>
  43. </t>
  44. <input t-if="question.matrix_subtype == 'multiple'" type="checkbox" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)" t-att-value='col_label.id'/>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </xpath>
  50. </template>
  51. </odoo>