0

having an issue with dates in this case I'am trying to make some date calculations based on start and end dates but for some reason this errors keep giving issues

Traceback error is:

Error:
Odoo Server Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: <class 'TypeError'>: "'datetime.datetime' object is not callable" while evaluating
'action=model.update_all_project_history()'

Code:

if not date_start() > role.date_start.date() and role[index + 1] != False:
   date_end = role.date_start - timedelta(days=1)

I believe the if not is might be what is causing this issue.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Ron
  • 91
  • 8
  • Why do you use both `role.date_start` and `role.date_start()`? Did you mean to use `role.date_start` both times? – mkrieger1 Feb 17 '21 at 21:51
  • "is not callable" in the simplest of terms means you are writing `()` after something that shouldn't take `()`. `date_start()` might be the problem. – Kraigolas Feb 17 '21 at 21:55

0 Answers0