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

Issue with the many2many relation

By
Vladimir Misael Torres Rivas
on 9/25/14, 11:33 AM 576 views

I'm learning odoo programming from the veterinarian clinic example.  

The python code goes as following.

class vetclinic_animal(osv.Model):
    _name = "vetclinic.animal"
    _columns = {
        'name': fields.char('Name', size=64),
        'birthdate': fields.date('Birth Date'),
        'breed_id':fields.many2one('vetclinic.breed','Breed'),
        'classification_id': fields.many2one('vetclinic.classification','Classification'),
        'labels_ids':fields.many2many('vetclinic.labels','rel_animal_labels','animal_id','labels_id',string='Labels'),      

}

The problem looks like is with 'labels_ids', when I install this module on my Odoo the field for  'labels_ids'  ('Labels) does not show up in the form. However if I change that part of the code to:

        'labels_ids':fieldsfields.many2one('vetclinic.labels','Labels'),

It show up as expected in a many2one field. 

So, what's wrong with my code?

Thanks

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

1 follower(s)

Stats

Asked: 9/25/14, 11:33 AM
Seen: 576 times
Last updated: 3/16/15, 8:10 AM