I want to calculate period in months depends on a fields value
I type that :
start_date = fields.Datetime('Start Date')
end_date = fields.Datetime('End Date', compute='_get_end_date')
duration = fields.Integer(string='Duration')
@api.depends('start_date', 'duration')
def _get_end_date(self):
for record in self:
record.end_date = False
if record.start_date and record.duration:
record.end_date = record.start_date + \
timedelta(months=record.duration)
if I type timedelta as hour or days it work
any help?