-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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] project: hide create task stage option from the project kanban #140297
[FIX] project: hide create task stage option from the project kanban #140297
Conversation
26efb16
to
0872b85
Compare
0872b85
to
bef7b0b
Compare
71928e4
to
ec685ea
Compare
ec685ea
to
e1d5d81
Compare
eda9f61
to
c2461c8
Compare
c2461c8
to
cf696fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, I just have one comment 🙂
@@ -33,7 +38,7 @@ export class ProjectTaskKanbanRenderer extends KanbanRenderer { | |||
} | |||
|
|||
canCreateGroup() { | |||
return (super.canCreateGroup() && this.isProjectTasksContext() && this.props.list.isGroupedByStage) || this.props.list.isGroupedByPersonalStages; | |||
return (super.canCreateGroup() && this.isProjectTasksContext() && this.props.list.isGroupedByStage && (this.isProjectManager || !this.props.list.isGroupedByStage)) || this.props.list.isGroupedByPersonalStages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (super.canCreateGroup() && this.isProjectTasksContext() && this.props.list.isGroupedByStage && (this.isProjectManager || !this.props.list.isGroupedByStage)) || this.props.list.isGroupedByPersonalStages; | |
return (super.canCreateGroup() && this.isProjectTasksContext() && this.props.list.isGroupedByStage && this.isProjectManager) || this.props.list.isGroupedByPersonalStages; |
I don't think the second condition is useful (and besides, A && (B || !A)
is equivalent to A && B
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MissingNoShiny Done
Thank You
cf696fc
to
51d1bbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work! Some minor comments...
{ name: "Project One" }, | ||
]); | ||
const stageId = pyEnv['project.task.type'].create([ | ||
{ name: "New"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ name: "New"}, | |
{ name: "New" }, |
{ name: "New"}, | ||
]); | ||
pyEnv['project.task'].create([ | ||
{ name: 'task one', project_id: projectId, stage_id: stageId}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ name: 'task one', project_id: projectId, stage_id: stageId}, | |
{ name: 'task one', project_id: projectId, stage_id: stageId }, |
}, function () { | ||
|
||
QUnit.test("quick create button is visible when the user has access rights.", async function (assert) { | ||
|
||
serviceRegistry.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, function () { | |
QUnit.test("quick create button is visible when the user has access rights.", async function (assert) { | |
serviceRegistry.add( | |
}, function () { | |
QUnit.test("quick create button is visible when the user has access rights.", async function (assert) { | |
serviceRegistry.add( |
{ force: true }, | ||
); | ||
|
||
const views = this.views; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const views = this.views; | |
const { views } = this; |
Doesn't that work?
QUnit.test("quick create button is not visible when the user not have access rights.", async function (assert) { | ||
|
||
const views = this.views; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QUnit.test("quick create button is not visible when the user not have access rights.", async function (assert) { | |
const views = this.views; | |
QUnit.test("quick create button is not visible when the user not have access rights.", async function (assert) { | |
const { views } = this; |
- No blank line needed.
- Can't we extract
views
fromthis
, as above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@auon-odoo all changes are done
thanks
/* @odoo-module */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the one in addons/project/static/src/views/project_task_kanban/project_task_kanban_renderer.js
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary :)
saas-16.3 is the current branch target, so we will take it off the master during the forward port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes you're right. But then why is the branch named master-...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it has been retargetted. Ok :)
51d1bbb
to
3ed85b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks!
Due to the project user's inability to create a task stage, we have removed the 'create stage' option from the kanban view. task-3511164
3ed85b6
to
3797322
Compare
robodoo r+ |
Due to the project user's inability to create a task stage, we have removed the 'create stage' option from the kanban view. task-3511164 closes #140297 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
7 similar comments
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed): |
Due to the project user's inability to create a task stage, we have removed the
'create stage' option from the kanban view.
task-3511164