Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1122 Lượt xem

Hi All,

I have created a stage in the Contacts module to differentiate between customers and vendors. Additionally, I set up separate menus for customers and vendors.

However, I am facing an issue in the Kanban view where I can't fold certain stages based on an existing boolean field.

Could anyone advise on how to implement folding stages in the Kanban view using this boolean field?


Stage model



stage in list



in kanban view

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

To enable stage folding in a Kanban view, you need to add the attribute group_expand to the stage_id field in your model(res.partner).


Python

from odoo import fields, models


class ResPartner(models.Model):
_inherit = 'res.partner'

stage_id = fields.Many2one('contacts.stage', string='Status',
group_expand='_read_group_expand_full')

Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

got the answer

@api.model
def _read_group_stage_ids(self, stages, domain):
search_domain = [('id', 'in', stages.ids)]
stage_ids = stages.sudo()._search(search_domain, order=stages._order)
return stages.browse(stage_ids)

or if your all stage invisible then try below code

@api.model
def _read_group_stage_ids(self, stages, domain):
stage_ids = self.env['contacts.stage'].search([])
return stage_ids

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
4854
2
thg 10 16
5060
1
thg 8 24
1133
4
thg 8 24
1802
2
thg 3 24
7826