Post by emilie »

Hello,
I use Gantt for Odoo in 15 version.
I need to add a personnal field to my task values in gantt grid.
I edit controller.py in the Odoo module, to add it in the task list in this function :

 @http.route('/bryntum_gantt/load', type='http', auth='user')
    def bryntum_gantt_load(self, project_ids=None, only_projects=False, **kw):
    [...]
        tasks = [
                {
                    "id": self.task_id_template % task.id,
                    "name": '[' + task.hierarchical_level + '] ' + task.name,
                    "hierarchicalLevel": task.hierarchical_level,
     [...]

In bryntum_gantt_config value, I define my column list :

columns: [
    {
      type: "sequence",
      id: 'br_column_1'
    },
    {
      field: "hierarchicalLevel",
      text: "Niveau hiérarchique",
      id: 'br_column_11'
    },
    {
      type: "name",
      text: "Nom",
      width: 250,
      id: 'br_column_2',
      editor: false
    }
    ]

The request /bryntum_gantt/load? correctly return values with the new field but my grid is always empty :

Odoo-Tâches.png
Odoo-Tâches.png (25.04 KiB) Viewed 1124 times

How can I display the values of my field in a dedicated column? Is the TaskStore properly populated with its changes?


Post by Terence »

The new fields should be defined in the model as well to be displayed. This is currently not supported. There is a ticket open for this.

https://github.com/bryntum/odoo-support/issues/47

I could add some empty fields to the model as a quick fix for the next release, like field_n to field_5 to map to.


Post by emilie »

Thank you, but how can I update my odoo module when the next release is available ? Should I repurchase the module?


Post by Terence »

You can just download the new release upcoming week from the odoo appstore. You do not need to repurchase.


Post by Terence »

I have added a couple of free Task fields to which you can map to.

{ name : 'field_1' },
            { name : 'field_2' },
            { name : 'field_3' },
            { name : 'field_4' },
            { name : 'field_5' },

Map hierarchicalLevel to one of above in JSON.

In the column configuration use something like

{
      field: "field_1",
      text: "Niveau hiérarchique",
      id: 'br_column_11'
    },

Released under 1.3.7


Post by emilie »

Thank you very much, I will test soon.


Post by emilie »

Hi, I have some errors with the new version 1.3.7 :

From Tasks menu, load Bryntum Gantt view
From Tasks menu, load Bryntum Gantt view
Capture d’écran 2022-08-10 à 15.09.14.png (37.46 KiB) Viewed 1065 times
From Projects Menu, all project tasks, load Bryntum Gantt view
From Projects Menu, all project tasks, load Bryntum Gantt view
Capture d’écran 2022-08-10 à 15.09.02.png (67.53 KiB) Viewed 1065 times

Post by Terence »

I can not reproduce. Can you reproduce it on https://odoo-gantt.bryntum.com ?

Or do you use some specific configurations?


Post by emilie »

No, I tried clearing my config, Uninstall then reinstall module, I always have errors


Post by Terence »

Did you modify any model? Can you install it on a clean database?

Sometimes it can help to upgrade the underlying project model as well.


Post Reply