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.

44 lines
2.8 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. <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'/>
  18. <t t-if="question.matrix_subtype == 'custom'">
  19. <textarea t-if="col_label.type == 'free_text'" class="form-control" rows="3" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"></textarea>
  20. <input t-if="col_label.type == 'textbox'" type="text" class="form-control" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  21. <input t-if="col_label.type == 'numerical_box'" type="number" step="any" class="form-control" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  22. <!-- <div t-if="col_label.type == 'date'" class='input-group date' t-attf-id="#datetimepicker_#{question.id}_#{row_label.id}_#{col_label.id}" data-target-input="nearest">
  23. <input type="text" class="form-control datetimepicker-input" t-attf-data-target="#datetimepicker_#{question.id}_#{row_label.id}_#{col_label.id}" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)"/>
  24. <div class="input-group-append" t-attf-data-target="#datetimepicker_#{question.id}_#{row_label.id}_#{col_label.id}" data-toggle="datetimepicker">
  25. <div class="input-group-text"><i class="fa fa-calendar"></i></div>
  26. </div>
  27. </div> -->
  28. <select t-if="col_label.type == 'dropdown'" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)" class="form-control" id="seldpbox1">
  29. <option></option>
  30. <t t-foreach="col_label.value_ids" t-as="dpv">
  31. <option t-att-value="dpv.id"><t t-esc="dpv.name"/></option>
  32. </t>
  33. </select>
  34. <input t-if="col_label.type == 'checkbox'" type="checkbox" t-att-name="'%s_%s_%s' % (prefix, row_label.id, col_label.id)" t-att-value='col_label.id'/>
  35. </t>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </xpath>
  41. </template>
  42. </odoo>