Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] sale_timesheet: correct the context when viewing a contact's SO… #35792

Closed

Conversation

fah-mili
Copy link

…'s tasks

When accessing a SO's tasks from Contacts (the partner_id's page), and
calling action_view_task, the active_id first corresponds to the contact's id.
Therefore, if a project.project exists with the contact's id, one can access
the SO's tasks, but otherwise, we get the error

Record does not exist or has been deleted.

(Records: [partner_id], User: ...)

Thus, if there is one corresponding project, we first update the context:
active_ids is set to project_id,
allowing access to the SO's corresponding project's tasks.
Note that the same thing is done lower:

eval_context.update({'active_id': task_projects.id})

which is too late to avoid trying to access the wrong record.

In the case where there are more than 1 corresponding projects (or if
there are no corresponding tasks), we don't have the issue.

OPW 2052559

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

…'s tasks

When accessing a SO's tasks from Contacts (the partner_id's page), and
calling action_view_task, the active_id first corresponds to the contact's id.
Therefore, if a project.project exists with the contact's id, one can access
the SO's tasks, but otherwise, we get the error

Record does not exist or has been deleted.

(Records: [partner_id], User: ...)

Thus, if there is one corresponding project, we first update the context:
active_ids is set to project_id,
allowing access to the SO's corresponding project's tasks.
Note that the same thing is done lower:

eval_context.update({'active_id': task_projects.id})

which is too late to avoid trying to access the wrong record.

In the case where there are more than 1 corresponding projects (or if
there are no corresponding tasks), we don't have the issue.

OPW 2052559
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Aug 19, 2019
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Aug 19, 2019
Copy link
Contributor

@len-foss len-foss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

@robodoo robodoo added error 🙅 and removed r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Aug 19, 2019
@robodoo
Copy link
Contributor

robodoo commented Aug 19, 2019

Staging failed: ci/runbot on 7ca33ec436e402c5606e4d60d9af607596c24375 (view more at http://runbot.odoo.com/runbot/build/593533)

@KangOl
Copy link
Contributor

KangOl commented Aug 19, 2019

@robodoo retry

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses r+ 👌 and removed error 🙅 labels Aug 19, 2019
@robodoo robodoo closed this in f9f288c Aug 19, 2019
@robodoo
Copy link
Contributor

robodoo commented Aug 19, 2019

Merged at f9f288c, thanks!

@len-foss len-foss deleted the 12.0-opw2052559-sale_timesheet-fah-2 branch August 19, 2019 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants