Odoo Help


relating own module to product.category

on 4/14/14, 4:23 PM 1,498 views

Hi folks,

I'm creating a model for some objects and I want to classify them the same way products are classified by categories. I try to relate this module to product.category and I get this reference error.

Programming Error. There is no reference available for product.category

This is my code:

from osv import osv, fields

class my_model(osv.Model):
    _name = "my.model"
    _columns = {
        #Basic properties
        'obj_name':fields.char('Name', size = 64, required=True),
        'obj_manufac_date':fields.date('Manufacturing Date'),

        'obj_category_id':fields.many2one('product.category', 'Category'),

Is there something else I need to make this work?

Thank you all,


On 4/14/14, 4:56 PM

check in the __openerp__.py file depend module product is added.
"depends": ['product']

Thanks so much. It worked fine.

on 4/16/14, 2:01 PM

please mark the answer as correct if it worked for you. Thanks

on 4/18/14, 5:57 AM

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: 4/14/14, 4:23 PM
Seen: 1498 times
Last updated: 3/16/15, 8:10 AM