diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 3d7cce06af0..8511eadbd7f 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -423,7 +423,7 @@ class orm_template(object): model_id = cr.fetchone()[0] if 'module' in context: name_id = 'model_'+self._name.replace('.', '_') - cr.execute('select * from ir_model_data where name=%s and res_id=%s and module=%s', (name_id, model_id, context['module'])) + cr.execute('select * from ir_model_data where name=%s and module=%s', (name_id, context['module'])) if not cr.rowcount: cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \ (name_id, context['module'], 'ir.model', model_id) @@ -2561,7 +2561,7 @@ class orm(orm_template): # add the NOT NULL constraint cr.commit() try: - cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k)) + cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k), log_exceptions=False) cr.commit() self.__schema.debug("Table '%s': column '%s': added NOT NULL constraint", self._table, k) @@ -2667,7 +2667,7 @@ class orm(orm_template): if f.required: try: cr.commit() - cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k)) + cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k), log_exceptions=False) self.__schema.debug("Table '%s': column '%s': added a NOT NULL constraint", self._table, k) except Exception: diff --git a/bin/service/web_services.py b/bin/service/web_services.py index ea776ed8b58..dcb4fc1feb2 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -223,7 +223,7 @@ class db(netsvc.ExportService): self._create_empty_database(db_name) - cmd = ['pg_restore', '--no-owner', '-w'] + cmd = ['pg_restore', '--no-owner'] if tools.config['db_user']: cmd.append('--username=' + tools.config['db_user']) if tools.config['db_host']: diff --git a/bin/sql_db.py b/bin/sql_db.py index aed10423bb7..a7d46d78e00 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -128,11 +128,11 @@ class Cursor(object): params = params or None res = self._obj.execute(query, params) except psycopg2.ProgrammingError, pe: - if log_exceptions or self.sql_log: + if log_exceptions: self.__logger.error("Programming error: %s, in query %s", pe, query) raise except Exception: - if log_exceptions or self.sql_log: + if log_exceptions: self.__logger.exception("bad query: %s", self._obj.query or query) raise