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
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!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|
2
led 24
|
4689 | |||
|
2
čvn 18
|
8017 | |||
|
2
lis 16
|
16404 | |||
|
2
úno 24
|
14826 | |||
|
0
říj 23
|
4837 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.