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

relating own module to product.category

By
jgonzalez
on 4/14/14, 4:23 PM 1,156 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,

jgonzalez

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
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.

jgonzalez
on 4/16/14, 2:01 PM

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

Prakash
on 4/18/14, 5:57 AM

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