mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt backup app
This commit is contained in:
@@ -15,6 +15,8 @@ class AppAutoBackup(http.Controller):
|
||||
@http.route("/dbbackup/download/<path:file_path>", type="http", auth="user")
|
||||
def download_backupfile(self, file_path, **kw):
|
||||
_logger.warning('download_backupfile: %s', file_path)
|
||||
if not self.env.user.has_group('base.group_system'):
|
||||
raise UserError(_('File not found for user.'))
|
||||
if os.path.exists(file_path):
|
||||
try:
|
||||
with open(file_path, 'rb') as file:
|
||||
@@ -28,4 +30,4 @@ class AppAutoBackup(http.Controller):
|
||||
except Exception as e:
|
||||
raise UserError(e)
|
||||
else:
|
||||
return 'File not found'
|
||||
return 'File not found'
|
||||
|
||||
Reference in New Issue
Block a user