diff --git a/auto_backup/__manifest__.py b/auto_backup/__manifest__.py
index 095945f..366c538 100644
--- a/auto_backup/__manifest__.py
+++ b/auto_backup/__manifest__.py
@@ -19,7 +19,7 @@
'author': "Yenthe Van Ginneken",
'website': "http://www.odoo.yenthevg.com",
'category': 'Administration',
- 'version': '17.0.0.1',
+ 'version': '18.0.0.1',
'installable': True,
'license': 'LGPL-3',
'module_type': 'official',
diff --git a/auto_backup/data/backup_data.xml b/auto_backup/data/backup_data.xml
index 7e008ee..e36add0 100644
--- a/auto_backup/data/backup_data.xml
+++ b/auto_backup/data/backup_data.xml
@@ -1,6 +1,5 @@
-
-
+
Backup scheduler
@@ -9,10 +8,6 @@
5
1
days
- -1
False
- False
-
-
diff --git a/auto_backup/models/db_backup.py b/auto_backup/models/db_backup.py
index 2f56a79..9cc010d 100644
--- a/auto_backup/models/db_backup.py
+++ b/auto_backup/models/db_backup.py
@@ -1,4 +1,3 @@
-
import os
import datetime
import time
@@ -7,6 +6,7 @@
import tempfile
import subprocess
from odoo import models, fields, api, tools, _
+from odoo.tools.misc import exec_pg_environ, find_pg_tool
from odoo.exceptions import UserError, AccessDenied
import odoo
@@ -272,9 +272,11 @@ def schedule_backup(self):
# call. Since this function is called from the cron and since we have these security checks on model and on user_id
# its pretty impossible to hack any way to take a backup. This allows us to disable the Odoo database manager
# which is a MUCH safer way
+
def _take_dump(self, db_name, stream, model, backup_format='zip'):
"""Dump database `db` into file-like object `stream` if stream is None
return a file object with the dump """
+ print(stream)
cron_user_id = self.env.ref('auto_backup.backup_scheduler').user_id.id
if self._name != 'db.backup' or cron_user_id != self.env.user.id:
@@ -283,8 +285,8 @@ def _take_dump(self, db_name, stream, model, backup_format='zip'):
_logger.info('DUMP DB: %s format %s', db_name, backup_format)
- cmd = [tools.find_pg_tool('pg_dump'), '--no-owner', db_name]
- env = tools.exec_pg_environ()
+ cmd = [find_pg_tool('pg_dump'), '--no-owner', db_name]
+ env = exec_pg_environ()
if backup_format == 'zip':
with tempfile.TemporaryDirectory() as dump_dir:
diff --git a/auto_backup/views/backup_view.xml b/auto_backup/views/backup_view.xml
index c860eaa..1f13f24 100644
--- a/auto_backup/views/backup_view.xml
+++ b/auto_backup/views/backup_view.xml
@@ -66,27 +66,27 @@
-
- db.backup.tree
+
+ db.backup.list
db.backup
- tree
+ list
-
+
-
+
Configure back-ups
db.backup
- tree,form
-
+ list,form
+