Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
My question is how i can call a dynamic current datetime in a function (not the static datetime) ?
for r in self:
if r.start_date and r.date_now:
dt = r.start_date
ft = r.date_now
d1 = datetime.strptime(dt, "%Y-%m-%d %H:%M:%S").date()
d2 = datetime.strptime(ft, "%Y-%m-%d %H:%M:%S").date()
rd = relativedelta(d2, d1)
date_now = fields.Datetime('Date', default=fields.Datetime.now) <-- it returns the date of creation .. then the result of the function is not synchronize with the actual date.
So i am looking for a way to get a date that change every moment
Hope that my question is clear
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/6/16, 12:47 PM|
|Seen: 887 times|
|Last updated: 4/7/16, 11:51 AM|