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

Search tag is not working in odoo 8

By
Odoo
on 12/30/14, 6:34 AM 1,176 views

   class hr_employee(osv.osv):
    _inherit = 'hr.employee'
    _columns = {
                'badge_number':fields.char('B/No',required=True),
                }
    
    
hr_employee()

 

<record model='ir.ui.view' id='hr_model_search'>
            <field name="name">hr.model.search</field>
            <field name="model">hr.employee</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
               <search string="Badge Number" >
                    <field name="badge_number" />  #cannot search custom badge number
                </search>
            </field>
     </record>

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 12/30/14, 6:46 AM

Inherit in search view and add the custom field

<record id="view_employee_badge_search" model="ir.ui.view">
            <field name="name">hr.employee.badge.search</field>
            <field name="model">hr.employee</field>
            <field name="inherit_id" ref="hr.view_employee_filter" />
            <field name="arch" type="xml">
           
             <search string="Employees">
                 <field name="badge_number" />  #make change then its working
            
            </search>

              </field>
            </search>
            </field>
</record>

https://doc.odoo.com/6.0/developer/2_6_views_events/views/view_inheritence/

 

Hi, Thanks for ur replay ...This code is not working.....

Odoo
on 12/30/14, 7:18 AM

Hi Prakash its working

Odoo
on 12/30/14, 7:32 AM

@LIBU Search view inherit add field using "after" or "before" tag. then only it search default openerp HR module search field in the search box otherwise its search only badge_number

Prakash
on 12/30/14, 7:48 AM
1
Umashankar Subramani
On 12/30/14, 6:47 AM

          You can try this one,

<search string="Badge Number">
                <group expand="0" string="Group By...">
                        <filter string="Name"  domain="[]" context="{'group_by':'badge_number'}"/>
                    </group>

</search>

Hi, Thanks for ur replay ...This code is not working.....

Odoo
on 12/30/14, 7:18 AM
Hi,
   Its working for me , may be u need to check or give me your code i try to correct it.

On Tue, Dec 30, 2014 at 5:48 PM, LIBU <libukoshym@mail.odoo.com> wrote:

Hi, Thanks for ur replay ...This code is not working.....

--
LIBU
Sent by Odoo Inc. using Odoo about Forum Post False



--
Thanks & Regards
Umashankar Subramani
Associate software engineer
Mitosis Technologies Pvt Ltd
Contact no: 9884878902

Umashankar Subramani
on 12/30/14, 10:34 AM
0
John Baldwin
On 12/30/14, 6:43 AM

Your class should be in your .py file, not sure why you are calling it as a function? and your serch should be in .xml after having placed the field in your hr_employee_form_view.xml...

https://www.odoo.com/documentation/8.0/reference/views.html

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: 12/30/14, 6:34 AM
Seen: 1176 times
Last updated: 3/16/15, 8:10 AM