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.


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

on 1/13/14, 10:58 AM 719 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,


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