Odoo Help

0

relating own module to product.category

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

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.

Register

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)

Stats

Asked: 4/14/14, 4:23 PM
Seen: 1353 times
Last updated: 3/16/15, 8:10 AM