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

.py

class aa

_name = 'model.model1'

managers= fields.Many2one('model.model2')



class bb

_name = 'model.model2'

name = fields.Char()

manager_name = fields.Many2many('hr.employee')/////////////////////////////////////In xml i use many2many_tags


 I need to write domain (in xml) first model(ie, model.model1) based on manager_name from second model(ie, 'model.model2').

Assume , i select more than one manager_name from second model(ie, 'model.model2').

This view should only visible for those selected manager_name from second model(ie, 'model.model2').

Ảnh đại diện
Huỷ bỏ

You have mentioned "This view should only visible for those selected manager_name from second model(ie, 'model.model2').",so do you want to hide any field or view? or you want to display records based on domain? please describe more to understand.

Câu trả lời hay nhất

You have to use dynamic domain filter to complete this task.

please refer this - \https://www.linkedin.com/pulse/how-set-dynamic-domain-filter-many2one-field-odoo-rishan-malaka/

Ảnh đại diện
Huỷ bỏ