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 ?