Browse Source

May 20 [UPDT] : Updated 'auto_database_backup'

pull/317/head
AjmalCybro 1 year ago
parent
commit
4f44ae8c3d
  1. 2
      auto_database_backup/__manifest__.py
  2. 10
      auto_database_backup/doc/RELEASE_NOTES.md
  3. 34
      auto_database_backup/models/db_backup_configure.py

2
auto_database_backup/__manifest__.py

@ -22,7 +22,7 @@
{
'name': "Automatic Database Backup To Local Server, Remote Server,"
"Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 Odoo17",
'version': '17.0.3.0.1',
'version': '17.0.4.0.1',
'live_test_url': 'https://youtu.be/Q2yMZyYjuTI',
'category': 'Extra Tools',
'summary': 'Odoo Database Backup, Automatic Backup, Database Backup, Automatic Backup,Database auto-backup, odoo backup'

10
auto_database_backup/doc/RELEASE_NOTES.md

@ -20,4 +20,12 @@
#### Version 17.0.3.0.1
#### UPDT
- Fixed the errors while inputting list_db = False in odoo conf file.
- Fixed the errors while inputting list_db = False in odoo conf file.
## Module <auto_database_backup>
#### 21.05.2024
#### Version 17.0.4.0.1
#### UPDT
- Changed response.list_buckets() function to head_bucket().

34
auto_database_backup/models/db_backup_configure.py

@ -208,26 +208,26 @@ class DbBackupConfigure(models.Model):
operations for connection test"""
if self.aws_access_key and self.aws_secret_access_key:
try:
bo3 = boto3.client(
s3_client = boto3.client(
's3',
aws_access_key_id=self.aws_access_key,
aws_secret_access_key=self.aws_secret_access_key)
response = bo3.list_buckets()
for bucket in response['Buckets']:
if self.bucket_file_name == bucket['Name']:
self.active = True
self.hide_active = True
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'success',
'title': _("Connection Test Succeeded!"),
'message': _(
"Everything seems properly set up!"),
'sticky': False,
}
aws_secret_access_key=self.aws_secret_access_key
)
response = s3_client.head_bucket(Bucket=self.bucket_file_name)
if response['ResponseMetadata']['HTTPStatusCode'] == 200:
self.active = True
self.hide_active = True
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'success',
'title': _("Connection Test Succeeded!"),
'message': _(
"Everything seems properly set up!"),
'sticky': False,
}
}
raise UserError(
_("Bucket not found. Please check the bucket name and"
" try again."))

Loading…
Cancel
Save