~camptocamp/openobject-server/6.1-no-sql-constraint-abstract-model-1151703

« back to all changes in this revision

Viewing changes to openerp/osv/orm.py

  • Committer: Guewen Baconnier
  • Date: 2013-03-07 08:54:21 UTC
  • Revision ID: guewen.baconnier@camptocamp.com-20130307085421-zf623vogaxnx92jz
[FIX] add SQL constraints only for models stored in database (not on AbstractModel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3050
3050
 
3051
3051
        cr.commit()     # start a new transaction
3052
3052
 
3053
 
        self._add_sql_constraints(cr)
 
3053
        if getattr(self, '_auto', True):
 
3054
            self._add_sql_constraints(cr)
3054
3055
 
3055
3056
        if create:
3056
3057
            self._execute_sql(cr)