تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
7685 أدوات العرض

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

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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

الصورة الرمزية
إهمال
أفضل إجابة

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>



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 21
19112
1
نوفمبر 18
4533
2
أكتوبر 18
7743
3
يوليو 24
22663
3
أبريل 21
5947