Se rendre au contenu
Menu
Cette question a été signalée

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
Ignorer
Publications associées Réponses Vues Activité
1
août 17
22630
0
sept. 23
5229
0
févr. 21
2730
0
août 16
4259
2
juin 16
10338