Skip to content

Commit

Permalink
[FIX] project: avoid traceback on View Task in project sharing + othe…
Browse files Browse the repository at this point in the history
…r small bugfix

This commit will fix the following bugs:
- prevents a traceback to appear when clicking on View Task button in sub-tasks tab
	when in project sharing
- adds a forgotten state display in the sub-tasks tab in project sharing
	(was missing)
- in the kanban card sub-tasks dropdown, only the sub-tasks without project should
	toggle from In Progress to Done (previously every subtask toggled)

Task-3280844

closes odoo#128385

X-original-commit: 928c8cc
Signed-off-by: Xavier Bol (xbo) <[email protected]>
  • Loading branch information
bastvdn committed Jul 13, 2023
1 parent 7c07a73 commit db6b688
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ export class SubtaskKanbanList extends Component {
}

get fields() {
const { display_name, state, user_ids } = this.props.record.fields;
const { display_name, state, user_ids, project_id } = this.props.record.fields;
return {
display_name,
state,
user_ids,
project_id,
};
}

Expand All @@ -66,6 +67,9 @@ export class SubtaskKanbanList extends Component {
user_ids: {
field: getFieldFromRegistry(this.fields.user_ids.type, "many2many_avatar_user", "kanban"),
},
project_id: {
field: getFieldFromRegistry(this.fields.project_id.type, "project_private_task", "kanban")
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ QUnit.module('Subtask Kanban List tests', {
`<kanban js_class="project_task_kanban">
<field name="subtask_count"/>
<field name="closed_subtask_count"/>
<field name="project_id"/>
<templates>
<t t-name="kanban-box">
<div>
Expand Down
5 changes: 3 additions & 2 deletions addons/project/views/project_sharing_project_task_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<field name="state" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="priority" widget="priority" optional="show" nolabel="1"/>
<field name="state" widget="project_task_state_selection" nolabel="1"/>
<field name="name"/>
<field name="allow_milestones" invisible="1"/>
<field name="milestone_id"
Expand All @@ -203,8 +204,8 @@
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide"/>
<field name="stage_id" optional="show"/>
<button name="action_open_task" type="object" title="View Task" string="View Task" class="btn btn-link float-end"
context="{'form_view_ref': 'project.project_sharing_project_task_view_form'}"
attrs="{'invisible': &quot;[('project_id', '!=', False), ('project_id', '!=', active_id)]&quot;}"/>
context="{'form_view_ref': 'project.project_sharing_project_task_view_form', 'search_view_ref': 'project.project_sharing_project_task_view_search'}"
attrs="{'invisible': &quot;['|', ('project_id', '=', False), ('project_id', '!=', active_id)]&quot;}"/>
</tree>
</field>
</page>
Expand Down

0 comments on commit db6b688

Please sign in to comment.