I was trying to add 90 days to a date field:
for record in self:
record['x_studio_90_days'] = record.x_studio_det_days + datetime.timedelta(days=90)
however I am getting an error. Please help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I was trying to add 90 days to a date field:
for record in self:
record['x_studio_90_days'] = record.x_studio_det_days + datetime.timedelta(days=90)
however I am getting an error. Please help
Hi Neil,
Check this forum post: https://www.odoo.com/forum/help-1/how-to-add-42-days-to-an-date-field-108946
Thank you
I have tried that one but it gives me a lot of errors
Hi,
Try this:
if record.x_studio_det_days:
record['x_studio_90_days'] = record.x_studio_det_days + datetime.timedelta(days=90)
Thank you
Hi Neil Matan,
Try,
from dateutil.relativedelta import relativedelta
self.event_start = fields.Date.today() + relativedelta(days=7)
record['x_studio_90_days'] = record.x_studio_det_days + relativedelta(days=90)
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jan 24
|
939 | ||
|
2
Jun 18
|
4699 | ||
|
2
Nov 16
|
11675 | ||
|
2
Feb 24
|
10969 | ||
|
0
Oct 23
|
1377 |