[FIX] Missing part of the revision 5f6fc473
authorSamus CTO <cto@openerp.com>
Mon, 25 Aug 2014 13:24:21 +0000 (15:24 +0200)
committerMartin Trigaux <mat@openerp.com>
Mon, 25 Aug 2014 16:01:38 +0000 (18:01 +0200)
openerp/models.py

index bfc25b0..018af58 100644 (file)
@@ -2675,7 +2675,7 @@ class BaseModel(object):
                                 dest_model = self.pool[f._obj]
                                 ref = dest_model._table
                                 # ir_actions is inherited so foreign key doesn't work on it
-                                if ref != 'ir_actions':
+                                if dest_model._auto and ref != 'ir_actions':
                                     self._m2o_add_foreign_key_checked(k, dest_model, f.ondelete)
                             if f.select:
                                 cr.execute('CREATE INDEX "%s_%s_index" ON "%s" ("%s")' % (self._table, k, self._table, k))