Post by moblitas »

Dear support,

I wonder if is possible open Gantt view from an specific project with button?

I have implemented a button in project.project model as follow, but it allways open with view_type = kanban

def open_gantt_pro(self):
        action = self.env.ref('project.act_project_project_2_project_task_all').read()[0]
        action.update({
            'view_mode': 'BryntumGantt',
            'view_type': 'BryntumGantt',
            'res_model': 'project.task',
            'target': 'current',
            'context': {'active_id': self.id},
        })
        return action

Thanks

Milton


Post by moblitas »

Dear support,

I found the way creating other action

<record id="action_gantt_project_task_view" model="ir.actions.act_window">
            <field name="name">Project Gantt</field>
            <field name="res_model">project.task</field>
            <field name="view_mode">BryntumGantt</field>
            <field name="domain">[('display_project_id', '=', active_id)]</field>
            <field name="context">{
                'default_project_id': active_id,
                'show_project_update': True,
                }
            </field>
        </record>

best regards


Post by Terence »

It possibly is, but not implemented at our end.

What is your requirement?


Post Reply