IMP attachment_minio improve requested parameters and bucket creation per testing.

This commit is contained in:
Jared Kipe
2019-07-02 14:44:30 -07:00
parent d6edc8d4ab
commit 3aa2819880
2 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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