How can I change a Datetime field to Date field based on a boolean?
is_half_day = fields.Boolean(string="Is half day?")
date_from = fields.Datetime('Start Date',
readonly=True,
index=True,
copy=False,
states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]},
track_visibility='onchange')
date_to = fields.Datetime('End Date',
readonly=True,
copy=False,
states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]},
track_visibility='onchange')