Odoo Help


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.


TypeError: Object has no method 'split'

on 3/14/14, 1:00 PM 1,125 views

Hello, I have a method where I am trying to append a set of ids to a many2one field base on certain criteria. I get the set of ids just fine, but when I return the list using an onchange method, then I get this error

TypeError: Object 61 has no method 'split'

This is the method that I am using

def on_change_get_sql_ver_set(self, cr, uid, ids, sql_ver_id, context=None):
    if sql_ver_id:

        sql_ver_obj = self.pool.get('product.sql.version')
        sql_rec = sql_ver_obj.browse(cr, uid, sql_ver_id)
        ids_set = sql_ver_obj.search(cr, uid, [('database_server','=', sql_rec.database_server)])
        # raise osv.except_osv('UserError',ids_set)
        recs = {}
        recs['product_sql_version_id'] = ids_set    #check ids_set
        return {'value': recs}

I will need to add more search conditions to this method to do what I need, but right now I just want to try and add this set to the many2one field on the form. does anyone know how I can add the set of returned data/ids to the many2one field

On 3/14/14, 2:00 PM

Well I found the solution. I had to change my return line to this:

return {'domain': {'product_sql_version_id': [('id', 'in', ids_set)]}}

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

0 follower(s)


Asked: 3/14/14, 1:00 PM
Seen: 1125 times
Last updated: 3/16/15, 8:10 AM