Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2598 Zobrazení

Hello! I'm trying to create a task kanban that involves tasks from all projects. But when a stage has no task, it does not appear in the kanban. Does anyone know how to make it appear?


Avatar
Zrušit
Nejlepší odpověď

Hi, 

If you want to show all stages, regardless of whether they have tasks or not, you can make use of the 'group_expand' attribute. Here's an example of how you can achieve this:

Example:

service_state = fields.Selection([('draft', 'Draft'), ('assigned', 'Assigned'),

                                 ('completed', 'Completed'), ('returned', 'Returned'),

                                 ('not_solved', 'Not solved')],

                                string='Service Status', group_expand='_group_expand_states',

                                default='draft', track_visibility='always')

In this example, the 'group_expand' attribute contains a function named ‘_group_expand_states.’ The function is defined as follows:

def _group_expand_states(self, states, domain, order):

   return [key for key, val in type(self).service_state.selection]


Here, the function '_group_expand_states' returns a list of states. It aims to pass all the selection fields in list form to the 'group_expand' method. In the XML, the state field is defined as a regular field, as illustrated in the above example.


Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
úno 24
1464
2
kvě 24
1689
1
čvn 23
3354
1
lis 22
3625
2
čvn 20
3834