From 3aa2819880efe2bef8c70b01419d5ef027fe1fcc Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 2 Jul 2019 14:44:30 -0700 Subject: [PATCH] IMP `attachment_minio` improve requested parameters and bucket creation per testing. --- attachment_minio/__manifest__.py | 4 +++- attachment_minio/models/ir_attachment.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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