تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
2453 أدوات العرض

I have managed to set the '__fold' to True in the _read_group_fill_results() function for the Kanban states I wish to fold in my model.py file.

def _read_group_fill_results(self, domain, groupby,
​remaining_groupbys, aggregated_fields,
​count_field, read_group_result,
​read_group_order=None):​

​results = super(myModelClass, self)._read_group_fill_results(
​domain, groupby, remaining_groupbys, aggregated_fields,
​count_field, read_group_result, read_group_order
​) 

​for result in results:
​state = result['status']
​result['__fold'] = state[0] in THE_LIST_OF_FOLDED_STATES

​return results

The THE_LIST_OF_FOLDED_STATES is populated from a Javascript function that calls the Python through a rpc.query call.

rpc.query({
​model: 'my.model.class',
​method: 'kanban_folded_state',
​args: ['in_progress','actioned'],
})

This calls kanban_folded_state in the model.py file.

@api.model
​def kanban_folded_state(self, *folded_states): 
​global THE_LIST_OF_FOLDED_STATES
​THE_LIST_OF_FOLDED_STATES= folded_states[:]

However, the actual Kanban view on the webpage doesn't reflect the folded state, unless I refresh the webpage (F5).

What I would like to do is to force the Kanban View to reflect the folded state for each stage programatically through Javascript following the rpc.query call.

Thanks,

Simon

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Thanks for your suggestion.

Following the rpc.query(); with  this.env.searchModel._notify(); doesn't result in the Kanban states being folded, unfortunately.

Do you have any other ideas?

Simon

الصورة الرمزية
إهمال
أفضل إجابة

Hi

Try the following,

If you are calling the RPC from the Kanban renderer then try this.env.searchModel._notify()

Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 23
2454
1
أبريل 24
1585
0
يناير 24
1290
1
سبتمبر 23
2568
2
أبريل 23
4650