From 484cf746a52fabe55381c07d55bf735c8f060c22 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 6 Jun 2012 16:19:08 +0200 Subject: [PATCH] [FIX] orm: remove unused `module` parameter when creating constraints This argument was not always present in the context (e.g when _auto_init is invoked for newly created custom fields via ir.model.field.create()), and was thus preventing the creation of custom fields. It was currently unused, and may be reintroduced soon after the cleanup of model metadata storage. bzr revid: odo@openerp.com-20120606141908-bdqxsarfb61yfw8m --- openerp/osv/orm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index e99296a15e1..e332799efdc 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -3076,7 +3076,7 @@ class BaseModel(object): cr.commit() # start a new transaction - self._add_sql_constraints(cr, context["module"]) + self._add_sql_constraints(cr) if create: self._execute_sql(cr) @@ -3203,7 +3203,7 @@ class BaseModel(object): _schema.debug("Create table '%s': m2m relation between '%s' and '%s'", m2m_tbl, self._table, ref) - def _add_sql_constraints(self, cr, module): + def _add_sql_constraints(self, cr): """ Modify this model's database table constraints so they match the one in