diff --git a/attachment_minio/__manifest__.py b/attachment_minio/__manifest__.py index 8bd4e98b..89d7402b 100755 --- a/attachment_minio/__manifest__.py +++ b/attachment_minio/__manifest__.py @@ -18,9 +18,11 @@ Before installing this app, you should add several System Parameters. Key : Example Value : Default Value +ir_attachment.location : s3 : _ + ir_attachment.location.host : minio.yourdomain.com : _ -ir_attachment.location.bucket : odoo_prod : _ +ir_attachment.location.bucket : odoo-prod : _ ir_attachment.location.region : us-west-1 : us-west-1 diff --git a/attachment_minio/models/ir_attachment.py b/attachment_minio/models/ir_attachment.py index ba987899..8e5dbba5 100644 --- a/attachment_minio/models/ir_attachment.py +++ b/attachment_minio/models/ir_attachment.py @@ -36,7 +36,8 @@ class MinioAttachment(models.Model): if not bucket: raise exceptions.UserError('Incorrect configuration of attachment_minio -- Missing bucket.') if not client.bucket_exists(bucket): - client.make_bucket(bucket) + region = params.get_param('ir_attachment.location.region', 'us-west-1') + client.make_bucket(bucket, region) return bucket @api.model