Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

View_sales_order_filter : How can I search product_id ?

By
kitcle
on 10/5/14, 1:06 PM 434 views

search / filter sale_order_line from Parent form 

0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 10/6/14, 3:46 AM

You have to do a workaround to achieve it....

product_id is present in Order lines, so if you want to make it available for Searching in Order object (parent).. you can achieve it using functional field and its search function...

In Order : add a functional field, and in _fnct_search, you write a logic to search through lines and fetch the parent ids...

it 's advance code but i'll try for me in the future thank you .

kitcle
on 10/7/14, 5:45 AM
0
PARVATHY VIJAYAN P
On 10/6/14, 5:48 AM

 

We can add filter domains.

<record id="search_view" model="ir.ui.view">
            <field name="name">name</field>
            <field name="model">sale.order</field>
            <field name="arch" type="xml">
                <search string="Search">

                       <!--Add this filter domain -->
                       <field name="order_line" filter_domain="[('order_line.product_id.name','ilike',self)]" string="Products"/>
                       <group expand="0" string="Group By...">
                       </group>
                </search>
            </field>
        </record>

Thank you it's easy code for me.

kitcle
on 10/7/14, 5:42 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/5/14, 1:06 PM
Seen: 434 times
Last updated: 3/16/15, 8:10 AM