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

Add option in search box odoo

By
Ajeng Shilvie
on 2/9/15, 6:09 AM 726 views

I want to add option in search box list view , i have parent and child object .. the parent option is show up . But Child option doesn't show up .. heres my code :

.xml

<!-- PARENT -->

        <record id="view_penerimaan_faktur_filter" model="ir.ui.view">
            <field name="name">penerimaan.faktur.list.select</field>
            <field name="model">wtc.penerimaan.faktur</field>
            <field name="arch" type="xml">
                <search string="Search Penerimaan Faktur">
                    <field name="name" string="Reference"/>
                    <field name="branch_id"/>  
                    <field name="partner_id" string="Supplier"/> 
                    <filter name="draft" string="Draft" domain="[('state','=','draft')]"/>
                    <filter name="post" string="Posted" domain="[('state','=','posted')]"/>
                    <group expand="0" string="Group By">
                        <filter string="Branch" icon="terp-partner" domain="[]" context="{'group_by':'branch_id'}"/>
                        <filter string="Tanggal" icon="terp-go-month" domain="[]" context="{'group_by':'tgl_terima'}"/>                    
                    </group>
                </search>
            </field>
        </record>

<!-- CHILD -->

         <record id="view_penerimaan_faktur_filter" model="ir.ui.view">
            <field name="name">penerimaan.faktur.line.search</field>
            <field name="model">wtc.penerimaan.faktur.line</field>
            <field name="arch" type="xml">
                <search string="Search Penerimaan Faktur">
                    <field name="name"/>
                    <field name="customer_stnk"/>                    
                    <group expand="0" string="Group By">
                        <filter name="groupby_engine" string="No Engine" icon="terp-partner" domain="[]" context="{'group_by' : 'name'}" />
                    </group>
                </search>
            </field>
        </record>
                   
        <record model="ir.actions.act_window" id="penerimaan_faktur_action">
            <field name="name">Penerimaan Faktur STNK</field>
            <field name="res_model">wtc.penerimaan.faktur</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="view_penerimaan_faktur_filter"/>
        </record>
        <record id="penerimaab_faktur_line_form_action2" model="ir.actions.act_window">
            <field name="name">On Penerimaan Faktur Lines</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">wtc.penerimaan.faktur.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="penerimaan_faktur_line_search"/>
        </record>    

=======================================================================================

if anyone know how to solve it , i beg u to share please.. thanks 

 

0

zbik

--zbik--
5951
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 2/9/15, 6:39 AM

You replace in child <record id="view_penerimaan_faktur_filter" model="ir.ui.view"> (duplicate names) by:

<record id="penerimaan_faktur_line_search" model="ir.ui.view">

in addition, in parent, filed tgl_terima is missing

yeah i forget, but still it doen't work .. the option didn't show up .. i just want to search by field in one2many (child) of the form , like purchase have product_id in search box. but my code seems doesn't work

Ajeng Shilvie
on 2/9/15, 6:46 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: 2/9/15, 6:09 AM
Seen: 726 times
Last updated: 3/16/15, 8:10 AM