AWS S3 bucket as the primary file storage in an Odoo instance.
Odoo-S3
uses boto
to talk to AWS. In addition, Odoo-S3
also uses boto3
in order to copy the existing filesystem filestore to S3. Hence, you will need to install both of them on the host running Odoo. Odoo-S3
will be migrated entirely on to boto3
in the future.
This module was written for Odoo v12.0 and is only tested with this particular version. However, It should work for Odoo v11.0 as well. Older versions of Odoo
might require some modifications.
In order to use Odoo-S3
you will need to switch to "Developer mode" and define a new system parameter as follows
ir_attachment.location ---> s3://<Your-AWS-Access-Key-ID>:<Your-AWS-Secret-Key>@<Your-S3-Bucket-name>
If the above configuration is present when the addon is installed, the existing filesystem based filestore will be copied to the above S3 bucket at the end of the installation. Otherwise, this needs to by done manually from the odoo shel (see below).
Following commands are available from the odoo shell.
- Copy existing filesystem based filestore to S3.
$> env['ir.attachment'].search([]).copy_filestore_to_s3()
- To check the status of the S3 filestore.
$> res_list, totals = env['ir.attachment'].search([]).check_s3_filestore()
Pull requests are welcome. The code is fairly short and easy to understand. All the magic happens in models.py
where the regular model ir_attachment
is extended.
This module is based on: