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: Saving and Task Creation Issues #143282
Conversation
af98581
to
78a09de
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.
Thank you @mjvi-odoo for your work 💯
I left one comment for you, its a bit long but I think it should be helpful for the first bug. If you have any questions feel free to shoot me a message on Discord.
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.
I do not think that this is really solving the bug reported.
What this method does is that it hides the project that the subtask has by default because we want to give the user the choice for whether they want the subtask to be shown or not in the project's views.
By removing this method, we remove that functionality which in this case is not correct.
The problem stems from a different place and it is here
Because the display_in_project
field is readonly and we don't specify the forcesave attribute, this method doesn't include it in its changes and thus doesn't allow the user to save.
We can add the force_save attribute in the xml of the field as you can see from the parser
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.
Hello @pkyriakou, I did changes as per you suggested and removed force_save from display_in_project field.
c32d83a
to
7bcf49d
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.
Thank you for your updates @mjvi-odoo
I left you some more comments.
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.
Hey @mjvi-odoo thank you for your changes but are you sure that this will fully solve the traceback on portal ?
As you can see here, the error stems from the recurrence_id
field.
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.
Yes, I confirm that the changes resolve the traceback issue with the recurrence_id field. @pkyriakou
@@ -383,7 +383,7 @@ | |||
widget="subtasks_one2many"> | |||
<tree editable="bottom" decoration-muted="state in ['1_done','1_canceled']" open_form_view="True"> | |||
<field name="allow_milestones" column_invisible="True"/> | |||
<field name="display_in_project" column_invisible="True" force_save="1"/> | |||
<field name="display_in_project" column_invisible="True"/> |
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.
Actually your change here is not correct, removing the force_save
here will just further break the feature. What the problem is is that the display_in_project field does not appear in the base task form and thus the force_save
is not inside the activeFields in the record class.
What you should do is add this line:
<field name="display_in_project" invisible="True" force_save="1"/>
in line 339 under the project_id
field.
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.
understood, I have made the changes as per your comment. @pkyriakou
7bcf49d
to
9076637
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.
Alright then, I have nothing else to comment on, thank you for the changes ✌️
2ea4f69
to
956bf08
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.
Hello @mjvi-odoo I added a question for you to look into 💪
@@ -529,7 +530,8 @@ | |||
<group> | |||
<field name="project_id" invisible="1" /> | |||
<field name="company_id" invisible="1" /> | |||
<field name="parent_id" domain="[('id', '!=', id)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> | |||
<field name="child_ids" invisible="1" /> | |||
<field name="parent_id" domain="[('id', '!=', id), ('id', 'not in', child_ids), ('parent_id.id', 'not in', child_ids)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> |
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.
Why is the third part needed for the domain ? the ('parent_id.id', 'not in', child_ids)
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.
I have added this third part to restrict sub-sub-task, but now I have updated code and added: '!', ('id', 'child_of', id)
956bf08
to
154771f
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.
Thank you @mjvi-odoo for the update. I left two minor comments regarding formatting 😁
<field name="child_ids" invisible="1" /> | ||
<field name="parent_id" domain="[('id', '!=', id),'!', ('id', 'child_of', id)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> |
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.
<field name="child_ids" invisible="1" /> | |
<field name="parent_id" domain="[('id', '!=', id),'!', ('id', 'child_of', id)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> | |
<field name="child_ids" invisible="1"/> | |
<field name="parent_id" domain="[('id', '!=', id), '!', ('id', 'child_of', id)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> |
Just formatting
@@ -140,7 +140,7 @@ | |||
</div> | |||
</button> | |||
<button name="action_project_sharing_open_subtasks" type="object" class="oe_stat_button" icon="fa-tasks" | |||
invisible="not id or subtask_count == 0" context="{'default_user_ids': [(6, 0, [uid])]}"> | |||
invisible="not id or subtask_count == 0" context="{'default_user_ids': [(6, 0, [uid])],'default_project_id': project_id }"> |
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.
invisible="not id or subtask_count == 0" context="{'default_user_ids': [(6, 0, [uid])],'default_project_id': project_id }"> | |
invisible="not id or subtask_count == 0" context="{'default_user_ids': [(6, 0, [uid])], 'default_project_id': project_id }"> |
154771f
to
19d3244
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 the fix
@@ -529,7 +530,8 @@ | |||
<group> | |||
<field name="project_id" invisible="1" /> | |||
<field name="company_id" invisible="1" /> | |||
<field name="parent_id" domain="[('id', '!=', id)]" context="{'search_default_project_id': project_id, 'search_default_open_tasks': 1}" /> | |||
<field name="child_ids" invisible="1"/> |
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.
Why is it needed in the view? 🤔
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.
my bad 🙈
Steps to reproduce: - Access the 'project.task' module. - Create a subtask. - Attempt to save the subtask after adding a project to it. Issue: - Saving a subtask becomes impossible when a project is added, causing an obstruction in the process. Solution: - Rectify the functionality to enable successful saving of a subtask even after adding a project, ensuring a seamless process for subtask creation and association with projects. task-3584963
Steps to reproduce: - In 'project sharing' create a task T in project A. - Add 2 subtasks to task T in project A. - Share project A in edit mode. - Access the view form of task T as a portal user. - Click on the subtask button to navigate to the tree/kanban view of subtasks. - Select the kanban view. - Create a new task on the fly, resulting in a traceback. Issue: - When a portal user creates a new task on the fly from the subtask kanban view, a traceback occurs, and the expected behavior of creating a new task Y in project A is not met. Additionally, task Y should not be a subtask of task T. Solution: - Resolve the traceback issue when creating a new task from the subtask kanban view as a portal user in project sharing. - Ensure that the new task Y is correctly created in project A and is not set as a subtask of task T. task-3584963
- Instead of raising an error, we simply exclude sub-tasks of the current task from the domain of the 'parent task' field task-3584963
19d3244
to
a7c522f
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 again for your work. 🙂
robodoo rebase-ff r+ |
Merge method set to rebase and fast-forward. |
Steps to reproduce: - Access the 'project.task' module. - Create a subtask. - Attempt to save the subtask after adding a project to it. Issue: - Saving a subtask becomes impossible when a project is added, causing an obstruction in the process. Solution: - Rectify the functionality to enable successful saving of a subtask even after adding a project, ensuring a seamless process for subtask creation and association with projects. task-3584963 Part-of: #143282
Steps to reproduce: - In 'project sharing' create a task T in project A. - Add 2 subtasks to task T in project A. - Share project A in edit mode. - Access the view form of task T as a portal user. - Click on the subtask button to navigate to the tree/kanban view of subtasks. - Select the kanban view. - Create a new task on the fly, resulting in a traceback. Issue: - When a portal user creates a new task on the fly from the subtask kanban view, a traceback occurs, and the expected behavior of creating a new task Y in project A is not met. Additionally, task Y should not be a subtask of task T. Solution: - Resolve the traceback issue when creating a new task from the subtask kanban view as a portal user in project sharing. - Ensure that the new task Y is correctly created in project A and is not set as a subtask of task T. task-3584963 Part-of: #143282
Steps to reproduce: - Access the 'project.task' module. - Create a subtask. - Attempt to save the subtask after adding a project to it. Issue: - Saving a subtask becomes impossible when a project is added, causing an obstruction in the process. Solution: - Rectify the functionality to enable successful saving of a subtask even after adding a project, ensuring a seamless process for subtask creation and association with projects. task-3584963 Part-of: odoo#143282
Steps to reproduce: - In 'project sharing' create a task T in project A. - Add 2 subtasks to task T in project A. - Share project A in edit mode. - Access the view form of task T as a portal user. - Click on the subtask button to navigate to the tree/kanban view of subtasks. - Select the kanban view. - Create a new task on the fly, resulting in a traceback. Issue: - When a portal user creates a new task on the fly from the subtask kanban view, a traceback occurs, and the expected behavior of creating a new task Y in project A is not met. Additionally, task Y should not be a subtask of task T. Solution: - Resolve the traceback issue when creating a new task from the subtask kanban view as a portal user in project sharing. - Ensure that the new task Y is correctly created in project A and is not set as a subtask of task T. task-3584963 Part-of: odoo#143282
- Instead of raising an error, we simply exclude sub-tasks of the current task from the domain of the 'parent task' field task-3584963 closes odoo#143282 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Current behavior before PR:
Desired behavior after PR is merged:
task-3584963
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr