Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
99 Vistas

Hello,


I've added a new field in the project.task class to calculate subtasks, and I've added a function to open a new task kanban filtered only by subtasks, but the problem is that when I add the filtered kanban, I lost click action to kanban and cannot open the task itself.


I think that the problem is because I'm not passing the specific action of task kanban. Example:


This is the url  when I open a specific project to see their tasks in the kanban, and are referencing action=183

web#action=183&active_id=2&model=project.task&view_type=kanban&cids=1&menu_id=112


And this is the same url filtering the same task kanban but with subtask id, but the problem is that I'm not referencing the task kanban action id, so I lost the click in the filtered kanban and cannot open filtered subtasks.

web#active_id=11&model=project.task&view_type=kanban&cids=1&menu_id=112


This is the function to open the filtered kanban, but I don't know who to add the action of task kanban. Maybe view_id?


def action_open_task_kanban(self, task_ids):

         return {

            'type': 'ir.actions.act_window',

            'name': 'Subtareas Filtradas',

            'res_model': 'project.task',

            'view_mode': 'kanban',

            'target': 'current',

            'domain': [('id', 'in', task_ids)],

        }


Thanks


Avatar
Descartar
Mejor respuesta

Hi,


Try the following code.


def action_open_task_kanban(self, task_ids):

    action = self.env.ref('project.action_view_task').read()[0]

    action.update({

        'name': 'Subtareas Filtradas',

        'domain': [('id', 'in', task_ids)],

    })

    return action



Hope it helps

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
dic 15
6159
1
ene 25
1850
0
abr 24
1447
2
mar 23
6863
0
ene 23
1826