Page 1 of 2
Add others fields in Grid ?
Posted: Wed Aug 03, 2022 1:41 pm
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 (25.04 KiB) Viewed 1256 times
How can I display the values of my field in a dedicated column? Is the TaskStore properly populated with its changes?
Re: Add others fields in Grid ?
Posted: Wed Aug 03, 2022 3:58 pm
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.
Re: Add others fields in Grid ?
Posted: Wed Aug 03, 2022 4:55 pm
by emilie
Thank you, but how can I update my odoo module when the next release is available ? Should I repurchase the module?
Re: Add others fields in Grid ?
Posted: Thu Aug 04, 2022 10:13 am
by Terence
You can just download the new release upcoming week from the odoo appstore. You do not need to repurchase.
Re: Add others fields in Grid ?
Posted: Mon Aug 08, 2022 10:20 pm
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
Re: Add others fields in Grid ?
Posted: Tue Aug 09, 2022 2:01 pm
by emilie
Thank you very much, I will test soon.
Re: Add others fields in Grid ?
Posted: Wed Aug 10, 2022 3:16 pm
by emilie
Hi, I have some errors with the new version 1.3.7 :
From Tasks menu, load Bryntum Gantt view Capture d’écran 2022-08-10 à 15.09.14.png (37.46 KiB) Viewed 1197 times
From Projects Menu, all project tasks, load Bryntum Gantt view Capture d’écran 2022-08-10 à 15.09.02.png (67.53 KiB) Viewed 1197 times
Re: Add others fields in Grid ?
Posted: Wed Aug 10, 2022 3:34 pm
by Terence
I can not reproduce. Can you reproduce it on https://odoo-gantt.bryntum.com ?
Or do you use some specific configurations?
Re: Add others fields in Grid ?
Posted: Wed Aug 10, 2022 4:08 pm
by emilie
No, I tried clearing my config, Uninstall then reinstall module, I always have errors
Re: Add others fields in Grid ?
Posted: Wed Aug 10, 2022 4:17 pm
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.