Page 1 of 1

Custom Gantt Toolbar in Odoo app

Posted: Wed Jul 06, 2022 7:29 pm
by emilie

Hi,
I use https://apps.odoo.com/apps/modules/15.0/bryntum_gantt_enterprise/ in Odoo 15 and I need to hide "CREATE" button in Toolbar :

Odoo-Tâches.png
Odoo-Tâches.png (21.54 KiB) Viewed 1351 times

Can I use the Gantt configuration object attribute and how ? or have to develop to do this customization ?
Thank you
Emilie


Re: Custom Gantt Toolbar in Odoo app

Posted: Thu Jul 07, 2022 1:14 pm
by Terence

Hi Emilie, currently the toolbar for the Odoo module is not fully configurable.

However, there is a configurable setting tbar which you can set in the gantt configuration settings panel, but then you will loose all other logic in the current toolbar.

If you describe your requirements I can make a ticket to make some settings in the toolbar configurable. I think that would be a nice feature request.


Re: Custom Gantt Toolbar in Odoo app

Posted: Thu Jul 07, 2022 2:01 pm
by emilie

Hi Terrence,
I want to delete/hide or disable the create button in Toolbar through the configuration field, as I can do it in the features block for the TaskEdit like this:

taskEdit      : {
      editorConfig : {
            bbar : {
                // Remove delete button
                items : {
                    deleteButton : false
                }
            },
        }
 }

Best regards,
Emilie


Re: Custom Gantt Toolbar in Odoo app

Posted: Thu Jul 07, 2022 3:43 pm
by Terence

Re: Custom Gantt Toolbar in Odoo app

Posted: Thu Aug 11, 2022 2:23 pm
by emilie

Hi,
how can I use the evolution ?
I download the last version and I add a block in first level configuration ?
I tried this but it's not working :

{
  tbar: {
    items: {
      addTaskButton: false
    }
}

Re: Custom Gantt Toolbar in Odoo app

Posted: Thu Aug 11, 2022 3:39 pm
by Terence

The items are configured in an array. Bit hard to override, Maybe we should change that.

But you can use the paint event and get the button from the widgetmap. Like;

{
  tbar: {
    onPaint: ({source}) => {
		source.widgetMap.addTaskButton.hidden = true;
	}
 }
}

Re: Custom Gantt Toolbar in Odoo app

Posted: Fri Aug 12, 2022 10:37 am
by emilie

Thank you very much, it works very well.