Change a compulsory field to optional

Hi guys, how can I change a compulsory field to an optional field on the sample? For example the “Date Sampled”. I tried to add required=0 on the field in the analysisrequest.py but it doesn’t work.
I change
DateTimeField(
'DateSampled',
mode="rw",
read_permission=View,
write_permission=FieldEditDateSampled,
widget=DateTimeWidget(
label=_("Date Sampled"),
description=_("The date when the sample was taken"),
size=20,
show_time=True,
datepicker_nofuture=1,
visible={
'add': 'edit',
'secondary': 'disabled',
'header_table': 'prominent',
},
render_own_label=True,
),
),
To
DateTimeField(
'DateSampled',
mode="rw",
required=0,
read_permission=View,
write_permission=FieldEditDateSampled,
widget=DateTimeWidget(
label=_("Date Sampled"),
description=_("The date when the sample was taken"),
size=20,
show_time=True,
datepicker_nofuture=1,
visible={
'add': 'edit',
'secondary': 'disabled',
'header_table': 'prominent',
},
render_own_label=True,
),
),

By general rule adding the required=False statement in a content type field should be enough to mark it as optional, but some fields save data required by the system. DateSampled can be one of them because its visibility is modified based on active workflows: senaite.core/widgetvisibility.py at 1f82dcfacb151e764b4ddad330c536714bfa7c20 · senaite/senaite.core · GitHub

I am pointing to some other fragments of code I found after a quick search. Please, do not take them as a final answer, but for some guidance!

Thank you very much, it’s very helpful