Trợ giúp

1

Kanban: Define wich columns appear folded / expanded

Avatar
Matthias Hülsmann

Hi all,

from hr.employee I make use of the kanban view, which is grouped by 32 departments. The last four columns however appear folded in kanban view. Its reproducable, but I can determin where this is defined?

I double-checked the departments, there is no flag. Secondly I tried

_fold_name = 'fold'

fold = fields.Boolean(default=False)

which does not expand all coloumns either.

Where is the state of a column defined?

Regards,
Matthias


Ảnh đại diện
Huỷ bỏ
1 Trả lời
0
Avatar
Anabela
Best Answer
Example in crm_lead.py , filling the parameter group_expand in stage it will do the folding in kanban.

 stage_id = fields.Many2one('crm.stage'string='Stage'track_visibility='onchange'index=True,
        domain="['|', ('team_id', '=', False), ('team_id', '=', team_id)]",
        group_expand='_read_group_stage_ids'default=lambda selfself._default_stage_id())

    @api.model
    def _read_group_stage_ids(selfstagesdomainorder):
        # retrieve team_id from the context and write the domain
        # - ('id', 'in', stages.ids): add columns that should be present
        # - OR ('fold', '=', False): add default columns that are not folded
        # - OR ('team_ids', '=', team_id), ('fold', '=', False) if team_id: add team columns that are not folded
        team_id = self._context.get('default_team_id')
        if team_id:
            search_domain = ['|', ('id''in', stages.ids), '|', ('team_id''='False), ('team_id''=', team_id)]
        else:
            search_domain = ['|', ('id''in', stages.ids), ('team_id''='False)]

        # perform search
        stage_ids = stages._search(search_domain, order=order, access_rights_uid=SUPERUSER_ID)
        return stages.browse(stage_ids)
Ảnh đại diện
Huỷ bỏ