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

Many2many relation on the same model does not work

By
Tobias Wetzel
on 5/20/15, 10:27 PM 1,119 views

Hi,

I tried to extend the 'event.track' model with a Many2many relation on 'event.track' itself but I get a weird error.

My code:

class advanced_tracks(models.Model):
_inherit = 'event.track'

is_main_track = fields.Boolean(string="Is a Main Track", default="False")

chair_ids = fields.Many2many(comodel_name="res.partner", relation="track_chairs", column1="track", culomn2="chair", string="Chairs")

main_track = fields.Many2many(comodel_name="event.track", relation="minitracks", column1="main_track", culomn2="mini_track_ids")
mini_track_ids = fields.Many2many(comodel_name="event.track", relation="minitracks", column1="mini_track_ids", culomn2="main_track")

The error:

ProgrammingError: column minitracks.mini_track_ids does not exist
LINE 1: SELECT minitracks.event_track_id, minitracks.mini_track_ids ...

Does anybody have an idea how to fix that?

upgraded module after the change?

Temur
on 5/21/15, 4:59 AM

yes I have

Tobias Wetzel
on 5/21/15, 3:34 PM
0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 5/25/15, 8:58 AM

You have a typo in cour code... check :.

chair_ids = fields.Many2many(comodel_name="res.partner", relation="track_chairs", column1="track", culomn2="chair", string="Chairs")


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: 5/20/15, 10:27 PM
Seen: 1119 times
Last updated: 5/25/15, 8:58 AM