I placed this code in computed field
for record in self: if record[('record.x_studio_start_date')] !=False and record[('record.x_studio_end_date')] !=False: d1 = record.x_studio_start_date d2 = record.x_studio_end_date record['x_studio_number_of_days'] = (d2-d1).days else: record['x_studio_days_to_close'] = 0 and this the error I got |
ValueError: : "record.x_studio_start_date" while evaluating "for record in self:\n if record[('record.x_studio_start_date')] !=False and record[('record.x_studio_end_date')] !=False:\n d1 = record.x_studio_start_date\n d2 = record.x_studio_end_date\n record['x_studio_number_of_days'] = (d2-d1).days\n else:\n record['x_studio_days_to_close'] = 0\n\n"Can anyone help me to fix this I need to calculate days different between two dates using computed field