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," 'name': "Automatic Database Backup To Local Server, Remote Server,"
"Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 Odoo17", "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', 'live_test_url': 'https://youtu.be/Q2yMZyYjuTI',
'category': 'Extra Tools', 'category': 'Extra Tools',
'summary': 'Odoo Database Backup, Automatic Backup, Database Backup, Automatic Backup,Database auto-backup, odoo backup' '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 #### Version 17.0.3.0.1
#### UPDT #### 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""" operations for connection test"""
if self.aws_access_key and self.aws_secret_access_key: if self.aws_access_key and self.aws_secret_access_key:
try: try:
bo3 = boto3.client( s3_client = boto3.client(
's3', 's3',
aws_access_key_id=self.aws_access_key, aws_access_key_id=self.aws_access_key,
aws_secret_access_key=self.aws_secret_access_key) aws_secret_access_key=self.aws_secret_access_key
response = bo3.list_buckets() )
for bucket in response['Buckets']: response = s3_client.head_bucket(Bucket=self.bucket_file_name)
if self.bucket_file_name == bucket['Name']: if response['ResponseMetadata']['HTTPStatusCode'] == 200:
self.active = True self.active = True
self.hide_active = True self.hide_active = True
return { return {
'type': 'ir.actions.client', 'type': 'ir.actions.client',
'tag': 'display_notification', 'tag': 'display_notification',
'params': { 'params': {
'type': 'success', 'type': 'success',
'title': _("Connection Test Succeeded!"), 'title': _("Connection Test Succeeded!"),
'message': _( 'message': _(
"Everything seems properly set up!"), "Everything seems properly set up!"),
'sticky': False, 'sticky': False,
}
} }
}
raise UserError( raise UserError(
_("Bucket not found. Please check the bucket name and" _("Bucket not found. Please check the bucket name and"
" try again.")) " try again."))

Loading…
Cancel
Save