[FIX] calendar: fix required conditions for subfields of recurrent events
For recurrent events, many fields are set to define the recurrency; these fields are invisible unless (recurrency', '=', True). However there are fields that depend on fields to define the recurrency, which are required in some cases. However in case where recurrency is later set to False, no onchange cleans up the intermediary values (this is taken care of in the create), but the 'required' on the non-relevant fields might prevent from saving. We fix these cases by adding the recurrency in the list of requirements. opw 2002181 closes odoo/odoo#32698 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
committed by
Nans Lefebvre
parent
dea93a683b
commit
58d414ec1c
@@ -162,7 +162,7 @@
|
||||
<div class="o_row">
|
||||
<field name="end_type" attrs="{'required': [('recurrency', '=', True)]}"/>
|
||||
<field name="count" attrs="{'invisible': [('end_type', '!=', 'count')], 'required': [('recurrency', '=', True)]}"/>
|
||||
<field name="final_date" attrs="{'invisible': [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}"/>
|
||||
<field name="final_date" attrs="{'invisible': [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date'), ('recurrency', '=', True)]}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('rrule_type', '!=', 'weekly')]}" name="weekdays">
|
||||
@@ -182,10 +182,10 @@
|
||||
attrs="{'required': [('month_by', '=', 'date'), ('rrule_type', '=', 'monthly')],
|
||||
'invisible': [('month_by', '!=', 'date')]}"/>
|
||||
<field name="byday" string="The"
|
||||
attrs="{'required': [('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
|
||||
attrs="{'required': [('recurrency', '=', True), ('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
|
||||
'invisible': [('month_by', '!=', 'day')]}"/>
|
||||
<field name="week_list" nolabel="1"
|
||||
attrs="{'required': [('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
|
||||
attrs="{'required': [('recurrency', '=', True), ('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
|
||||
'invisible': [('month_by', '!=', 'day')]}"/>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user