This question has been flagged
1 Reply
6160 Views

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


Avatar
Discard
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)
Avatar
Discard

in my case i'm using simple states and i want to fold the state 'closed'

any help !