[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:
Guewen Baconnier 2013-03-07 09:58:26 +01:00
parent a096862741
commit c377140650
1 changed files with 2 additions and 1 deletions

View File

@ -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)