Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6895 Widoki

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')

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Abdul Halim,
You can add extra fields for Date and add condition in Views to switch Datetime to Date like in Calendar Event / Meetings . Refer Image attached here. 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 24
3270
1
sie 23
4871
2
lip 24
14133
2
gru 23
12718
3
lip 22
23092