Skip to content
Snippets Groups Projects
Commit cbbaa9df authored by ノウラ's avatar ノウラ Committed by nouraellm
Browse files

[FIX] project: Fix traceback when date_format is false


Current behaviour:
When the language is not set on the user date_format value
is False so when opening project tasks we get the following traceback

Error:
Odoo Server Error

Traceback (most recent call last):
  File '/Users/nea/src/odoo/odoo/addons/base/models/ir_http.py', line 237, in _dispatch
    result = request.dispatch()
        ....
  File '/Users/nea/src/odoo/addons/project/models/project.py', line 798, in _compute_recurrence_message
    task.recurrence_message += '<li>%s</li>' % date.strftime(date_format)
Exception

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

Traceback (most recent call last):
  File '/Users/nea/src/odoo/odoo/http.py', line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File '/Users/nea/src/odoo/odoo/http.py', line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
TypeError: strftime() argument 1 must be str, not bool

Expected behaviour:
- Open projects tasks with no problem

Fix:
- to fix the problem we use get_lang() to retrieve the language object for the current use

Affected versions:
- 14.0
- 15.0
- 16.0
- master

opw-3301081

closes odoo/odoo#120555

Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
parent 1b44748c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment