Post by jaykishan »

Terence wrote: Wed Jan 04, 2023 1:08 pm

Hi, you need to add the field in Task.js

static get fields() {
        return [
           ...
            {name: 'sequenceNumber', alwaysWrite: true},
           ...

silent initialCommit you can set on the Project model.

In the controller you need need to set the sequence number in

@property
    def default_fields(self): 

Hi Terence,

its not working in 'load' method. only working when i do any action on gannt view like reorder or expand project one by one then working.
is it possible to get sequenceNumber when i load the gantt view.

Last edited by jaykishan on Thu Jan 05, 2023 4:27 pm, edited 1 time in total.

Post by jaykishan »

Hello Terence,

After upgrading to Gantt View Pro Enterprise 1.3.9
we are not able to see icon. please check attached screenshot.
Do you have any idea how to fix this problem?

Thanks in advance.

Last edited by jaykishan on Thu Jan 05, 2023 11:28 am, edited 1 time in total.

Post by Terence »

No idea. Could you start a new thread?


Post by jaykishan »

jaykishan wrote: Thu Jan 05, 2023 7:32 am
Terence wrote: Wed Jan 04, 2023 1:08 pm

Hi, you need to add the field in Task.js

static get fields() {
        return [
           ...
            {name: 'sequenceNumber', alwaysWrite: true},
           ...

silent initialCommit you can set on the Project model.

In the controller you need need to set the sequence number in

@property
    def default_fields(self): 

Hi Terence,

its not working in 'load' method. only working when i do any action on gannt view like reorder or expand project one by one then working.
is it possible to get sequenceNumber when i load the gantt view.

Hi terence,

is it possible ?


Post by Terence »

It is currently not saved in the backend. If you want to get it saved you need to add the sequenceNumber field to the model and modify the controller as I described above. This is a customisation we do not add to the module, but you can modify it yourself.

And you need to add the field in the load function in the controller to get it returned on load.


Post by jaykishan »

Terence wrote: Fri Jan 06, 2023 1:18 pm

It is currently not saved in the backend. If you want to get it saved you need to add the sequenceNumber field to the model and modify the controller as I described above. This is a customisation we do not add to the module, but you can modify it yourself.

And you need to add the field in the load function in the controller to get it returned on load.

Task.js

static get fields() {
        return [
           ...
            {name: 'sequenceNumber', alwaysWrite: true},
           ...

projectModel.js

static get defaultConfig() {
        return {
            ...
            silenceInitialCommit : false,
            ...

controller.py


@property
    def default_fields(self): 
    	('sequenceNumber', 'sequenceNumber', None),
     

model.py

sequenceNumber = fields.Integer(string='sequenceNumber')

added field inside load

"sequenceNumber": task.sequenceNumber

i have added all the code.
but still getting 0 in sequenceNumber field (inside database) when load the gantt view.
let me know if i added code on wrong place.

Attachments
sequenceNumber.png
sequenceNumber.png (39.44 KiB) Viewed 436 times

Post by Terence »

What is done first?

1 you want to set sequence values returned from the controller.
2 init the database, the first time, with calculated sequence values

When you return and set sequence values (1) before (2) is done (correct me if I am wrong) you will probably get this result.

So, what is returned in the data loaded? You should return null (delete the value when it is not set) or return correct sequence values from the controller.


Post by jaykishan »

Terence wrote: Fri Jan 06, 2023 2:58 pm

What is done first?

1 you want to set sequence values returned from the controller.
2 init the database, the first time, with calculated sequence values

When you return and set sequence values (1) before (2) is done (correct me if I am wrong) you will probably get this result.

So, what is returned in the data loaded? You should return null (delete the value when it is not set) or return correct sequence values from the controller.

Hi Terence,

I think there is some confusion here. I don't want to fetch the sequence from controller and show it into gantt. but I want to get the sequence which is showing on gantt (which is generating dynamically) and store it inside our database.

Is it possible to do this?


Post by Terence »

Then do not return it in the load function.


Post by jaykishan »

Terence wrote: Fri Jan 06, 2023 4:02 pm

Then do not return it in the load function.

can you please elaborate? I don't understand your response.

Just to clarify again. Once the gantt is loaded it is sequencing all projects and tasks automatically. I want to fetch that sequence and store it inside another sequence field in my database inside project and task table. so how can i do that?


Post Reply