Odoo Help

Welcome!

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.

0

'list' object has no attribute 'get'

By
lam a bao
on 11/28/13, 5:15 AM 1,354 views

Hi everyone

I have :

class cvs_quotations_product(osv.osv):

_name="cvs.quotations.product"
def getcodesystemdoor(self, cr, uid, ids,fields, arg, context=None):
    x=[]
    getids= self.read(cr,uid,ids,['demomany2one'])[0]['demomany2one']
    get_oj=self.pool.get('product.category')
    search_oj=get_oj.search(cr, uid, [('id', '=',getids[0])])
    data_oj=get_oj.read(cr, uid, search_oj, ['parent_id'], context)
    for item in data_oj:
        for _item_child in item['parent_id']:
            if isinstance(_item_child,int):
                x.append(_item_child)
    return x
_columns={
    "demomany2one":fields.many2one("product.category","Chọn Hệ Vật Tư",translate=True),
    "codesystemdoor":fields.function(getcodesystemdoor,method = True, String='Demo')

}

cvs_quotations_product()

Result error : 'list' object has no attribute 'get'

Can you help me ?

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)

Stats

Asked: 11/28/13, 5:15 AM
Seen: 1354 times
Last updated: 3/16/15, 8:10 AM