[FIX] project: grouped by personal stages in kanban -> user == current user
Steps to reproduce ================== - Go to project > My tasks - Click on load More on the first column - Nothing is loaded Cause of the issue ================== The orm groups by stages for each stage where the user is the current one or null -> This returns a null stage when the left join has not match But we only want stages linked to the current user Solution ======== When loading project kanban groups and isGroupedByPersonalStages is true: Add the user_id to the domain This is the same solution applied in saas-15.3 https://github.com/odoo/odoo/blob/f463d9a6ba95c0df64268b1c577f1b9d1c5bcb25/addons/project/static/src/js/project_kanban.js#L342 opw-3033943 closes odoo/odoo#105367 X-original-commit: 1294ff85aa54aa195e2f1554c6ef426869b90c75 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
+13
@@ -1,6 +1,8 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { KanbanDynamicGroupList } from "@web/views/kanban/kanban_model";
|
||||
import { Domain } from '@web/core/domain';
|
||||
import { session } from '@web/session';
|
||||
|
||||
export class ProjectTaskKanbanDynamicGroupList extends KanbanDynamicGroupList {
|
||||
get context() {
|
||||
@@ -21,6 +23,17 @@ export class ProjectTaskKanbanDynamicGroupList extends KanbanDynamicGroupList {
|
||||
return !!this.groupByField && this.groupByField.name === 'personal_stage_type_ids';
|
||||
}
|
||||
|
||||
async _loadGroups() {
|
||||
if (!this.isGroupedByPersonalStages) {
|
||||
return super._loadGroups(...arguments);
|
||||
}
|
||||
const previousDomain = this.domain;
|
||||
this.domain = Domain.and([[['user_ids', 'in', session.uid]], previousDomain]).toList({});
|
||||
const result = await super._loadGroups(...arguments);
|
||||
this.domain = previousDomain;
|
||||
return result;
|
||||
}
|
||||
|
||||
async createGroup() {
|
||||
if (this.isGroupedByPersonalStages) {
|
||||
this.defaultContext = Object.assign({}, this.defaultContext || {}, {
|
||||
|
||||
Reference in New Issue
Block a user