mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
IMP attachment_minio improve requested parameters and bucket creation per testing.
This commit is contained in:
@@ -18,9 +18,11 @@ Before installing this app, you should add several System Parameters.
|
|||||||
|
|
||||||
Key : Example Value : Default Value
|
Key : Example Value : Default Value
|
||||||
|
|
||||||
|
ir_attachment.location : s3 : _
|
||||||
|
|
||||||
ir_attachment.location.host : minio.yourdomain.com : _
|
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
|
ir_attachment.location.region : us-west-1 : us-west-1
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ class MinioAttachment(models.Model):
|
|||||||
if not bucket:
|
if not bucket:
|
||||||
raise exceptions.UserError('Incorrect configuration of attachment_minio -- Missing bucket.')
|
raise exceptions.UserError('Incorrect configuration of attachment_minio -- Missing bucket.')
|
||||||
if not client.bucket_exists(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
|
return bucket
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
Reference in New Issue
Block a user