Commit 48fb5b0a authored by Rémi - Le Filament's avatar Rémi - Le Filament

Move conditional question and exclusive with mandatory

parent 03a22f34
......@@ -9,14 +9,15 @@
<field name="model">survey.question</field>
<field name="inherit_id" ref="survey.survey_question_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[2]" position="inside">
<group string="Conditions">
<field name="constr_mandatory" position="attributes">
<attribute name="attrs">{'invisible': [('conditional','=', True)]}</attribute>
</field>
<xpath expr="//page/group/group" position="inside">
<field name="survey_id" invisible="1" readonly="1" />
<field name="page_id" invisible="1" readonly="1" />
<field name="conditional"/>
<field name="conditional" attrs="{'invisible':[('constr_mandatory', '=', True)]}"/>
<field name="conditional_question_id" domain="[('type', '=', 'simple_choice'), ('survey_id', '=', survey_id), ('page_id', '=', page_id)]" attrs="{'invisible':[('conditional', '=', False)], 'required': [('conditional', '=', True)]}" options="{'no_create_edit': True,}"/>
<field name="conditional_option_id" attrs="{'invisible':['|', ('conditional', '=', False), ('conditional_question_id', '=', False)], 'required':[('conditional', '=', True)]}" domain="[('question_id','=',conditional_question_id)]" options="{'no_create_edit': True,}"/>
</group>
</xpath>
</field>
</record>
......@@ -33,4 +34,4 @@
</record>
</data>
</odoo>
\ No newline at end of file
</odoo>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment