Files
odoo_source/addons/project
Thomas Lefebvre (thle) 86ffeb2e5d [FIX] project: update token even if False
Steps to reproduce:
- take a project;
- change the visibility to allow sharing;
- click on "SHARE EDITABLE";
- share the project with a portal user;
- login as portal;
- try to open a project task.
Remark: the problem does not occur for all tasks.

Issue:
A traceback appears.

Cause:
Error occurs because: `return (token and record and consteq(record[token_field], token))`
compare two values with different type.
- `token` is equal to `'null'`
- `record[token_field]` is equal to `False`

In the code: `consteq = hmac_lib.compare_digest`

> `hmac.compare_digest(a, b)`
Return `a == b`.
This function uses an approach designed to prevent timing analysis
by avoiding content-based short circuiting behaviour, making it appropriate for cryptography.
a and b must both be of the same type:
either str (ASCII only, as e.g. returned by HMAC.hexdigest()), or a bytes-like object.
[source](https://docs.python.org/3/library/hmac.html#hmac.compare_digest)

The source of the problem is upstream to this comparison.
Indeed, we first test if we have a token.
As the value of the token is `'null'`, we pass the condition.

Solution:
It is necessary to have a token equal to `False` if the task has not token.
Therefore, whatever the value of the token (token value or `False`), we have to update the token.

opw-3217490

closes odoo/odoo#115947

X-original-commit: dd3a59fa28c5644be93cc2778e0c6854a4481d51
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-20 23:49:09 +01:00
..
2023-03-13 17:45:21 +01:00
…
2023-03-20 16:51:30 +01:00
2023-03-17 11:47:09 +01:00
…

Project Management

Infinitely flexible. Incredibly easy to use.

Odoo's collaborative and realtime open source project management helps your team get work done. Keep track of everything, from the big picture to the minute details, from the customer contract to the billing.

Designed to Fit Your Own Process

Organize projects around your own processes. Work on tasks and issues using the kanban view, schedule tasks using the gantt chart and control deadlines in the calendar view. Every project may have its own stages, allowing teams to optimize their job.

Easy to Use

Get organized as fast as you can think. The easy-to-use interface takes no time to learn, and every action is instantaneous, so there’s nothing standing between you and your sweet productive flow.

Work Together

Real-time chats, document sharing, email integration

Use the chatter to communicate with your team or customers and share comments and documents on tasks and issues. Integrate discussion fast with the email integration.

Talk to other users or customers with the website live chat feature.

Collaborative Writing

The power of etherpad, inside your tasks

Collaboratively edit the same specifications or meeting minutes right inside the application. The integrated etherpad feature allows several people to work on the same tasks, at the same time.

This is very efficient for scrum meetings, meeting minutes or complex specifications. Every user has their own color and you can replay the whole creation of the content.

Get Work Done

Get alerts on followed events to stay up to date with what interests you. Use instant green/red visual indicators to scan through what has been done and what requires your attention.

Timesheets, Contracts & Invoicing

Projects are automatically integrated with customer contracts, allowing you to invoice based on time & materials and record timesheets easily.

Track Issues

Single out the issues that arise in a project in order to have a better focus on resolving them. Integrate customer interaction on every issue and get accurate reports on your team's performance.