Skip to Content
Menu
This question has been flagged
2 Replies
6738 Views

Hi!


I'm trying to filter records on an embedded tree/list view (say: on the sale.order.line records in the sale.order form) that fullfill a certain criterion, say the product_id = 10.


I've tried setting up domains on several levels and have tried embedding the view directly vs. using the "tree_view_ref" context, but to no avail; I'm aware that I can set the domain in the act_window, however, as the domain would need to be applied to the embedded view, not the main view, that doesn't seem to get me where I want either.


Any hints would be highly apprciated!


thanks

Herbert

Avatar
Discard
Author Best Answer

Hi Kevin,


thanks alot - in my case I'm not inheriting a view, I'm creating a new one (on my own model; the SO example was just as it comes very close to what I'm doing), your suggestion is equivalent to adding the same "domain" entry on the <field name=my_lines.../> I use to link to my child model, right? If so, that didn't fix the issue, had tried that already :-(


cheers

Herbert


PS: Just ran into the same issue again on R12 in another context - darn :-( really no solution here ? :-o

Avatar
Discard
Best Answer

Haven't checked if it works. Just give a try

<record id="some_id" model="ir.ui.view">
            <field name="name">some.name</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='order_line']" position="attributes">
                    <attribute name="domain">[['product_id', '=', 10]]</attribute>
                </xpath>
            </field>
</record>



Avatar
Discard
Related Posts Replies Views Activity
2
May 21
17605
1
Nov 18
3438
2
Oct 18
6614
3
Jul 24
21373
3
Apr 21
4784