Commit Graph
8 Commits
Author SHA1 Message Date
sebalix bff3161909 [9.0] [FIX] attachment_s3: Migrate to boto3
Backported https://github.com/camptocamp/odoo-cloud-platform/pull/48/commits/c61cf6c4e57fe7526c4df01ec32eaeb06023dc21
2020-02-25 09:19:13 +01:00
Guewen Baconnier d1bb60fc11 attachment_s3: bump 1.3.0 2018-06-13 17:26:08 +02:00
Guewen Baconnier 4d8400d0bf Fix Contacts view too slow to display
The 'base' Kanban view for res.partner in 9.0 loads the large 'image'
field in the 'search_read' but display the 'small_image'. The js code
also has to issue js calls to get the small images as they have not been
prefetched. This is noticeably slow to load when the large images are
read from S3 which is slower than a local filesystem/database.

This fix loads the 'small_image' instead of the large one.

This bug has been fixed in Odoo 10.0.
2017-02-09 11:49:23 +01:00
Guewen Baconnier 624cc0b743 Store files that need fast access in the database
An Object Storage read is slower than a disk of database access.
It might take ~200 to 300ms to retrieve a file content.

This is not an issue for attachments such as the pdf files or any
attachment that we want to read on demand. But that's too slow for
files needed to render a web page.

We'll store in the database:

* Assets (js, css, ...). As a side effect, the databases will be more
  portable, as assets are rebuilt frequently, storing them in the Object
  Storage led the integration server to try to read assets deleted since
  long ago
* Attachments linked to Binary fields named 'image_small',
  'image_medium', 'web_icon_data'. Those fields are often used on kanban
  views that display a lot a images and retrieving them all was then
  very slow (Odoo does not do async requests).

The migration to S3 is no longer called during initialization of the
registry: it would be too slow as we would have to define if the
attachments must be kept in database or sent to S3 on each new start. It
means we have to call `env['ir.attachment'].force_storage()` to run the
migration.
2017-01-16 17:12:52 +01:00
Guewen Baconnier 3c8b74369b Make pylint happy 2016-11-03 16:58:36 +01:00
Guewen Baconnier b5f00c26dc Fix pep8 2016-11-02 10:29:02 +01:00
Guewen Baconnier 1d4f76de2b Migrate attachments s3 to new pattern
So remove the compatibility code altogether
2016-11-01 08:55:00 +01:00
Guewen Baconnier 7825661a1a Add attachment_s3 2016-10-24 17:12:27 +02:00