From 7a49b4d409354f0a393e67152584c6a031521fb7 Mon Sep 17 00:00:00 2001 From: archetipo Date: Wed, 25 Nov 2015 12:36:08 +0100 Subject: [PATCH] useless field --- auto_backup/model/backup_scheduler.py | 38 +++------------------------ auto_backup/view/bkp_conf_view.xml | 8 ------ 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/auto_backup/model/backup_scheduler.py b/auto_backup/model/backup_scheduler.py index be92c45e1..4fd421196 100644 --- a/auto_backup/model/backup_scheduler.py +++ b/auto_backup/model/backup_scheduler.py @@ -48,48 +48,16 @@ def execute(connector, method, *args): class DbBackup(models.Model): _name = 'db.backup' - def get_connection_uri(self, host, port, secure=False): - uri = 'http://%s:%s' % (host, port) - if secure: - uri = 'https://%s:%s' % (host, port) - return uri - - def get_connection(self, host, port, secure=False): - uri = self.get_connection_uri(host, port, secure) - return xmlrpclib.ServerProxy(uri + '/xmlrpc/db') - - def get_db_list(self, host, port, secure=False): - conn = self.get_connection(host, port, secure) - db_list = execute(conn, 'list') - return db_list - @api.model def _get_db_name(self): return self.env.cr.dbname - # Columns local server - host = fields.Char( - string='Host', default='localhost', size=100, required=True) - - securehost = fields.Boolean(string='Secure Host') - - port = fields.Char( - string='Port', default='8069', size=10, required=True) - name = fields.Char( string='Database', size=100, required=True, default=_get_db_name, help='Database you want to schedule backups for' ) - adminpassword = fields.Char( - string='Admin user Password', - help=( - "The password Admin password of Odoo Instance." - ), - required=True - ) - bkp_dir = fields.Char( string='Backup Directory', size=100, default='/odoo/backups', @@ -271,6 +239,9 @@ class DbBackup(models.Model): # user made a typo in his path with multiple slashes # (/odoo//backups/) it will be fixed by this regex. pathToWriteTo = re.sub('/+', '/', pathToWriteTo) + _logger.debug( + 'Start to copy files..' + ) try: srv.chdir(pathToWriteTo) except IOError: @@ -293,9 +264,6 @@ class DbBackup(models.Model): pass srv.chdir(pathToWriteTo) # Loop over all files in the directory. - _logger.debug( - 'Start to copy files...' - ) for f in os.listdir(dir): fullpath = os.path.join(dir, f) if os.path.isfile(fullpath): diff --git a/auto_backup/view/bkp_conf_view.xml b/auto_backup/view/bkp_conf_view.xml index 7527dfd80..cb2281b08 100644 --- a/auto_backup/view/bkp_conf_view.xml +++ b/auto_backup/view/bkp_conf_view.xml @@ -12,11 +12,7 @@ - - - - @@ -69,8 +65,6 @@ tree - - @@ -85,8 +79,6 @@ search - -