Permalink
Browse files

[FIX] fields: special case for broken m2m fields in 12.0

The model 'account.reconcile.model' contains two many2many fields that use the
same table.  As there is no way to fix this without breaking existing
databases, add an exception to the rule.
  • Loading branch information...
rco-odoo committed Dec 6, 2018
1 parent b2ab7ff commit d189d532680418533be1401a28afcc6401bdc645
Showing with 5 additions and 1 deletion.
  1. +5 −1 odoo/fields.py
@@ -2598,7 +2598,11 @@ def _setup_regular_full(self, model):
elif model._auto:
# add self in m2m, so that its inverse field can find it
if (self.relation, self.column1, self.column2) in m2m:
if (
(self.relation, self.column1, self.column2) in m2m
and self.model_name != 'account.reconcile.model'
):
# Note: 'account.reconcile.model' is not fixable in 12.0
_logger.error(
"Many2many fields %s and %s use the same table and columns",
self, m2m[(self.relation, self.column1, self.column2)],

0 comments on commit d189d53

Please sign in to comment.