Odoo Help


Object #<Object> has no method 'slice' OpenERP

on 1/13/14, 10:58 AM 1,107 views

Hello everybody,

I try to have a tree (with a line for each result) with all the product_bat which the name is not null

 My code: 

def _bat_names(self, cr, uid,ids, fields,args, context): 
bat_pool = self.pool.get('product.bat') 
bat_ids = bat_pool.search(cr,uid,[('name','!=','')]) 
bat_names = [(0, 0, {'name':bat.name}) for bat in bat_pool.browse(cr, uid, bat_ids)] 
res=dict([(m_id, bat_names) for m_id in ids]) 
return res 

'bat_names': fields.function(_bat_names, type='many2many', relation='product.bat', string='BAT Names') 

<field name="bat_names/">

But I have this error:

Object # has no method 'slice' OpenERP

Someone know why please?

Thank you a lot,


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: 1/13/14, 10:58 AM
Seen: 1107 times
Last updated: 3/16/15, 8:10 AM