Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
srp 17
22628
0
zář 23
5221
0
úno 21
2728
0
srp 16
4250
2
čvn 16
10320