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

self.pool.get('product.category') is none

By
lam a bao
on 11/14/13, 12:08 AM 1,544 views

from openerp.osv import osv, fields

class cvs_quotations(osv.osv): _name = "cvs.quotations"

def GetDataDoorssystem(self, cr, uid, context=None):
    product_category_obj = self.pool.get('product.category')
    ids = product_category_obj.search(cr, uid, [])
    datas = product_category_obj.read(cr, uid, ids, ['id', 'name'], context)
    return [(r['id'], r['name']) for r in datas]

_columns = {
    "saleordercode": fields.char("Sale order Code", translate=True),
    "doorsystem": fields.selection(GetDataDoorssystem, "Chọn hệ cửa", translate=True),
}

cvs_quotations()

when i execute this class ,it error : 'NoneType' object has no attribute 'search' .Because self.pool.get('product.category') is none .Can you help me ?

Thanks hungnt skype:lamabao_lovely

1
Julien Laloux
On 11/14/13, 8:59 AM

Does your __openerp__.py contains the dependency on product module?

thanks

lam a bao
on 11/20/13, 4:45 AM
1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 11/14/13, 1:24 AM

Hello lam a bao,

I guess you didn't install product module. Make sure product module is installed if not then install it and then try your code.

Thanks,

Serpent Consulting Services.

but I have installed the product module

lam a bao
on 11/14/13, 3:13 AM
0
lam a bao
On 11/14/13, 3:12 AM

Thanks

But I have installed the product module

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/14/13, 12:08 AM
Seen: 1544 times
Last updated: 3/16/15, 8:10 AM