Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4011 Visualizzazioni

Hi, first of all, thank you for reading this post. I am new to Odoo and python, so I appreciate that you are taking time to help.


I want to show a specific value in my kanban view, depending if the datetime in the database correspond to todays's date.


I have a datetime variable in my model.

datetime_contact = fields.Datetime(string="Date of contact")


In the Kanban view I want to show the 'time_contact_char' if the day of datetime_contact is equal to today's date.  if not, I want to show the 'date_contact_char' field.


This is the code from the kanban view. 


What should I put in the condition to check if current datetime_contact field is from today? 

  

t-if="record.datetime_contact.value == ???"


*what I want to accomplish is what gmail use for showing the time of the email in the inbox. If the email was received today it shows the time. If the email was received another day, it shows the date. For example "8:53 AM" if the email is from today  "Jun 14" if the email is from Yesterday

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
ago 17
22659
0
set 23
5251
0
feb 21
2743
0
ago 16
4278
2
giu 16
10358