diff --git a/openerp/models.py b/openerp/models.py index f2441ef9ca3..7d4f6e5220a 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -2585,8 +2585,8 @@ class BaseModel(object): self._set_default_value_on_column(cr, k, context=context) # add the NOT NULL constraint try: - cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k), log_exceptions=False) cr.commit() + cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k), log_exceptions=False) _schema.debug("Table '%s': column '%s': added NOT NULL constraint", self._table, k) except Exception: