Odoo Help

2

"relation already exists" after adding a Many2many field

By
Ludwik Trammer
on 9/26/14, 10:49 AM 1,017 views

I've defined the following two models:

class Weekday(models.Model):
    _name = 'ludwik.offers.weekday'
    name = fields.Char()

class Duration(models.Model):
    _name = 'ludwik.offers.duration'
    weekday = fields.Many2many('ludwik.offers.weekday')

When I try to start odoo I get the following message:

ProgrammingError: relation "ludwik_offers_duration_ludwik_offers_weekday_rel_ludwik_offers_" already exists

Also, when I change the _name properties in models, the problem persists (of course the relation name in the error message changes to reflect the rename), so it's not like it's just a conflict with some old relations already existing in the database.

For people experiencing similar issues. I figured this out and explained the issue in detail here: http://stackoverflow.com/a/26101401/262618

Ludwik Trammer
on 9/30/14, 3:38 PM

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

1 follower(s)

Stats

Asked: 9/26/14, 10:49 AM
Seen: 1017 times
Last updated: 3/16/15, 8:10 AM