Hello,
What I want to do is show filtered One2many fields using tree view.
I have One2many fields like below
subscription_line_ids = fields.One2many('subscription.subscription.line', 'subscription_id')
And subscription.subscription.line model has stage field
stage = fields.Selection(
[('draft', 'Draft'),
('in progress', 'In Progress'),
('closed', 'Closed')],
default='draft')
so I tried using domain on xml like below
<field name="subscription_line_ids"
domain="[('subscription_line_ids.stage', '=', 'in progress')]"
>
<tree editable="bottom">
<field name="stage" />
<field name="close_reason_id"/>
</tree>
</field>
But the domain not working
How can I solve this problem?
I know I can do on *.py but I don't want to make fields for every stage.