Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
745 Widoki

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?

Awatar
Odrzuć