[FIX] base: make constraint on ir.model.fields.relation_table more robust

The constraint checks the table name with a regexp, and the latter crashes when
the field has value `False`.
This commit is contained in:
Raphael Collet
2016-08-31 11:58:56 +02:00
parent b717f3c4be
commit e481cfce72
+2 -1
View File
@@ -318,7 +318,8 @@ class IrModelFields(models.Model):
@api.one
@api.constrains('relation_table')
def _check_relation_table(self):
models.check_pg_name(self.relation_table)
if self.relation_table:
models.check_pg_name(self.relation_table)
@api.model
def _custom_many2many_names(self, model_name, comodel_name):