[IMP] survey_extra_fields: new params max_file_size and allowed_extensions for file question type
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m45s

This commit is contained in:
2026-02-18 17:49:33 +01:00
parent e45bccc3e3
commit b63b8ba885
9 changed files with 241 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_question_form_inh" model="ir.ui.view">
<field name="name">survey.question.form.inherit.extra_fields</field>
<field name="model">survey.question</field>
<field name="inherit_id" ref="survey.survey_question_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='options']//field[@name='matrix_subtype']" position="before">
<field name="max_file_size"
attrs="{'invisible': [('question_type', '!=', 'file')]}"
string="Max File Size (MB)"/>
<field name="allowed_extensions"
attrs="{'invisible': [('question_type', '!=', 'file')]}"
placeholder=".pdf,.docx,.xlsx"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -24,6 +24,9 @@
class="o_survey_question_file"
t-att-name="question.id"
t-att-data-question-type="question.question_type"
t-att-accept="question.allowed_extensions or None"
t-att-data-max-file-size="question.max_file_size or None"
t-att-data-allowed-extensions="question.allowed_extensions or None"
/>
</t>
</div>