[FIX] add SQL constraints only for models stored in database (not on AbstractModel)
lp bug: https://launchpad.net/bugs/1151703 fixed bzr revid: guewen.baconnier@camptocamp.com-20130307085826-omhoc3clix41zydl
This commit is contained in:
parent
a096862741
commit
c377140650
|
@ -3204,7 +3204,8 @@ class BaseModel(object):
|
|||
|
||||
cr.commit() # start a new transaction
|
||||
|
||||
self._add_sql_constraints(cr)
|
||||
if getattr(self, '_auto', True):
|
||||
self._add_sql_constraints(cr)
|
||||
|
||||
if create:
|
||||
self._execute_sql(cr)
|
||||
|
|
Loading…
Reference in New Issue