Hello, I am trying to create a calculated field that will calculate the difference in days between two dates. I have tried this way but it does not work for me
for record in self:
record[(x_dpuerto)] = record(datetime.now()) - record(x_farribo)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello, I am trying to create a calculated field that will calculate the difference in days between two dates. I have tried this way but it does not work for me
for record in self:
record[(x_dpuerto)] = record(datetime.now()) - record(x_farribo)
Hi,
record[(x_dpuerto)] is it a static or a dynamic field ..???
If its static you can go with Mr. Niyas's Answer,
If its a dynamic one ie, difference between two dates when you calculate on today is 20 and for tomorrow it will be 21 ..???
Hi,
Try like this,
days = (date_1 - date_2).days
Thanks
Hello, thank you for answering me so quickly, I am new to using odoo and I would like to create a calculated field that gives me the difference in days between two dates. I don't know much about programming but I would like to get a solution to my problem. thanks in advance
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
3
Juni 25
|
722 | ||
|
1
Juli 23
|
3434 | ||
|
4
Dez. 22
|
9404 | ||
|
1
Okt. 18
|
4846 | ||
|
1
Okt. 16
|
4254 |