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] project: hide create task stage option from the project kanban #140297

Conversation

kusi-odoo
Copy link
Contributor

@kusi-odoo kusi-odoo commented Oct 30, 2023

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

@robodoo
Copy link
Contributor

robodoo commented Oct 30, 2023

@C3POdoo C3POdoo added the RD research & development, internal work label Oct 30, 2023
@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch 3 times, most recently from 26efb16 to 0872b85 Compare December 12, 2023 12:31
@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch from 0872b85 to bef7b0b Compare December 20, 2023 08:57
@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch 3 times, most recently from 71928e4 to ec685ea Compare January 4, 2024 13:32
@ppr-odoo ppr-odoo force-pushed the master-project-user-stage-visible-kusi branch from ec685ea to e1d5d81 Compare January 8, 2024 10:11
@kusi-odoo kusi-odoo changed the base branch from master to saas-16.3 January 8, 2024 10:44
@kusi-odoo kusi-odoo changed the base branch from saas-16.3 to master January 8, 2024 10:51
@kusi-odoo kusi-odoo changed the base branch from master to saas-16.3 January 8, 2024 12:46
@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch 4 times, most recently from eda9f61 to c2461c8 Compare January 9, 2024 09:18
@kusi-odoo kusi-odoo changed the title [IMP] project: improved creating a personal stage according to access… [FIX] project: hide create task stage option from the project kanban Jan 9, 2024
@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch from c2461c8 to cf696fc Compare January 9, 2024 10:38
Copy link
Contributor

@MissingNoShiny MissingNoShiny left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MissingNoShiny Done
Thank You

@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch from cf696fc to 51d1bbb Compare February 2, 2024 10:57
Copy link
Contributor

@auon-odoo auon-odoo left a 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"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ name: "New"},
{ name: "New" },

{ name: "New"},
]);
pyEnv['project.task'].create([
{ name: 'task one', project_id: projectId, stage_id: stageId},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ name: 'task one', project_id: projectId, stage_id: stageId},
{ name: 'task one', project_id: projectId, stage_id: stageId },

Comment on lines 46 to 48
}, function () {

QUnit.test("quick create button is visible when the user has access rights.", async function (assert) {

serviceRegistry.add(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}, 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const views = this.views;
const { views } = this;

Doesn't that work?

Comment on lines 72 to 74
QUnit.test("quick create button is not visible when the user not have access rights.", async function (assert) {

const views = this.views;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 from this, as above?

Copy link
Contributor Author

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

Comment on lines +1 to +2
/* @odoo-module */

Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary :)

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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-...?

Copy link
Contributor

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 :)

@kusi-odoo kusi-odoo force-pushed the master-project-user-stage-visible-kusi branch from 51d1bbb to 3ed85b6 Compare March 19, 2024 05:41
Copy link
Contributor

@auon-odoo auon-odoo left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks!

@xavierbol xavierbol marked this pull request as ready for review March 27, 2024 14:10
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
@xavierbol xavierbol force-pushed the master-project-user-stage-visible-kusi branch from 3ed85b6 to 3797322 Compare March 27, 2024 14:11
@xavierbol
Copy link
Contributor

robodoo r+

@C3POdoo C3POdoo requested a review from a team March 27, 2024 14:28
robodoo pushed a commit that referenced this pull request Mar 27, 2024
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>
@fw-bot
Copy link
Contributor

fw-bot commented Mar 31, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

7 similar comments
@fw-bot
Copy link
Contributor

fw-bot commented Apr 1, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 2, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 3, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 4, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 5, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 6, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

@fw-bot
Copy link
Contributor

fw-bot commented Apr 8, 2024

@kusi-odoo @xavierbol this pull request has forward-port PRs awaiting action (not merged or closed):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants