Hello. I am trying to solve this for several days. We have a lot of sub-tasks in Sub-tasks tab in form view of project.task, so we want to dynamically filter this list by four particular tags. I want this filter setting to be saved at each task, so I have created toggle switch fields for each tag. here is my code for one of them:
Python:
tag1Visible = fields.Boolean('tag1Visible')
XML:
field name="tag1Visible" widget="boolean_toggle"/
Also I have managed to create duplicate of Sub-tasks tab without affecting it:
Python:
filteredSubtasks = fields.One2many('project.task', 'parent_id', store=True, copy=False)
XML:
field name="filteredSubtasks"
I have tried to add the domain to the field, like domain=[('tag_ids', 'in', 3 )]
which successfully filters out tasks with tag id=3
Now I want to make this domain to change dynamically depending on boolean toggle switches.
Can you help me finish the code?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
767
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký