duplicate_database missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned | ||
OpenERP Community Backports (Server) |
New
|
Undecided
|
Unassigned | ||
6.1 |
New
|
Undecided
|
Unassigned |
Bug Description
on webinterface is not possible to duplicate db as on version 7
this will fix bug:
=== modified file 'openerp/
--- openerp/
+++ openerp/
@@ -101,7 +101,7 @@
def dispatch(self, method, params):
if method in [ 'create', 'get_progress', 'drop', 'dump',
- 'restore', 'rename',
+ 'restore', 'rename', 'duplicate_
passwd = params[0]
@@ -126,6 +126,18 @@
finally:
+ def exp_duplicate_
+ _logger.
+ sql_db.
+ db = sql_db.
+ cr = db.cursor()
+ try:
+ cr.autocommit(True) # avoid transaction block
+ cr.execute(
+ finally:
+ cr.close()
+ return True
+
def exp_create(self, db_name, demo, lang, user_password=
self.id += 1
@@ -185,11 +197,17 @@
# Try to terminate all other connections that might prevent
# dropping the database
try:
- cr.execute(
+
+ # PostgreSQL 9.2 renamed pg_stat_
+ # http://
+ pid_col = 'pid' if cr._cnx.
+
+ cr.execute(
- WHERE datname = %s AND
- procpid != pg_backend_
+ WHERE datname = %%s AND
+ %(pid_col)s != pg_backend_pid()""" % {'pid_col': pid_col},
+
except Exception: