Odoo Help


How to Search for product references only in Order line

on 12/10/13, 1:09 PM 2,279 views

Working on Windows.

I am trying to search reference/default_code of products from the sale order line without considering the case but only searching the beginning of each reference. similar to searching LIKE 's%' in sql. At the moment OpenERP search LIKE '%s%' is it possible to have a code that ---

    get product_id in product.product 
    for default_code (that is reference) like ? (search+'%',)

I want to apply this to sales order line for getting the products. Please anyone help. thanks Also I should say all products have unique reference (default_code) and we only search by these. So I would be glad if anyone could suggest how I can make the search look in the reference only rather than both reference and product name. Thank you in advance. python code:

def onchange_case(self, cr, uid, ids, default_code):
    result = {'value': {
        'default_code': str(default_code).upper()
    return result

xml code:

           <field name="default_code" on_change="onchange_case(default_code)"/>

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 12/10/13, 2:35 PM

use the lower() or upper() function to format the user input.

This will require your database to be uniformly upper or lower case, but that is easier to control than user input.

thanks but unfortunately the database is already live and doing this will be lots of work, all old orders and moves may require changes too

on 12/12/13, 9:49 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 12/10/13, 1:09 PM
Seen: 2279 times
Last updated: 7/11/16, 5:56 PM