Skip to Content
Menu
This question has been flagged
4 Replies
5752 Views

Hello forum,


i'm very new in developing odoo (odoo 9) and one of my first tries is to make the phone number of my partners searchable.


My first try was like this:

from openerp import models,

fieldsclass App_phone(models.Model):

_name = 'res.partner'

_inherit = 'res.partner'

phone = fields.Char(index=True)


and of course this did not work out.


how i a change a existing field like phone to make it searchable?

With the debug-mode it is not possible


Thanks a lot

Avatar
Discard

You need to set filter of phone no ?

Author

yes that's right

Author

okay not only filter i want to use the search-field to find contacts in a fast way while you tip in the phone number

Best Answer

You can either click on "Filters" and then "Add Custom Filter" to search by phone number or install your own module view adding the search feature. 

When making your own module I am not entirely sure if you will need to create a .py file. What you will need to do is create a xml file with

<?xml version="1.0" encoding="UTF-8"?>
    <openerp>
        <data>

        <record id="YOUR_VIEW_NAME" model="ir.ui.view">
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="RES_PARTNER_SEARCH_VIEW"/>
             <field name="arch" type="xml">
                <search string="CUSTOM_NAME">
                    <field name="PHONE_ID"/>
                </search>
             </field>

        </data>
    </openerp>

I am not what the search view is called, or the phone field. You can check those out in the settings under "User Interface" and "Views". Hope it helps point you in the right way!

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
66
0
Dec 24
40
1
Dec 24
47
0
Dec 24
55
0
Nov 24
64