Commit Graph
257 Commits
Author SHA1 Message Date
Miku LaitinenandYannick Vaucher 10e8bf6931 [FIX] Bucket name formatting 2021-05-31 09:46:51 +02:00
Yannick VaucherandGitHub 43fa8e57c1 Merge pull request #224 from yvaucher/14.0-multi-tenancy
[14.0] attachment_s3: multi-tenancy use db name in bucket
2021-05-27 18:14:03 +02:00
Yannick Vaucher 83e203c1aa attachment_s3: multi-tenancy use db name in bucket
Adds the possibility to insert `{db}` placeholder in the bucket name
that will be replaced by the database name to form a unique bucket
name per database.
2021-05-18 17:09:38 +02:00
Yannick VaucherandGitHub a182ea6542 Merge pull request #212 from p-tombez/mig14_monitoring_log_requests
[MIG] monitoring_log_requests: Migration to 14.0
2021-04-12 20:52:07 +02:00
Patrick TombezandGitHub f52f364b31 Merge pull request #214 from Kencove/fix_base_base64
remove base64 from base_attachment
2020-11-13 13:36:29 +01:00
Don Kendall 304a0afb03 clean trailing space for linter 2020-11-04 20:11:23 -05:00
Don Kendall 7ec3a1c94d remove base64 from base_attachment 2020-11-04 20:09:15 -05:00
Don Kendall ed92ada4ea remove base64 from base_attachment 2020-11-04 09:39:06 -05:00
Patrick TombezandGitHub 40f46317df Merge pull request #213 from p-tombez/fix_base64
[FIX] attachment modules: remove base64 encoding when reading files from storage
2020-11-04 10:46:45 +01:00
Patrick Tombez 1f0a6974fa [FIX] attachment modules: remove base64 encoding when reading files from storage 2020-11-04 10:41:26 +01:00
Patrick Tombez c72c52fc44 [MIG] monitoring_log_requests: Migration to 14.0 2020-11-03 16:15:51 +01:00
Patrick TombezandGitHub cf5ad883ac Merge pull request #211 from p-tombez/mig14_meta_modules
[MIG] meta modules: Migration to 14.0
2020-11-03 16:14:06 +01:00
Patrick Tombez 2dfb5cad6c [MIG] cloud_platform_ovh: Migration to 14.0 2020-11-03 15:58:32 +01:00
Patrick Tombez 6aca3bd521 [MIG] cloud_platform_exoscale: Migration to 14.0 2020-11-03 15:58:32 +01:00
Patrick Tombez fee088f695 [MIG] cloud_platform: Migration to 14.0 2020-11-03 15:58:32 +01:00
Patrick TombezandGitHub 4d6b260530 Merge pull request #205 from p-tombez/mig14_logging_json
[MIG] logging_json: Migration to 14.0
2020-11-03 15:57:27 +01:00
Patrick TombezandGitHub d6b3ccee9a Merge pull request #206 from p-tombez/mig14_session_redis
[MIG] session_redis: Migration to 14.0
2020-11-03 15:52:45 +01:00
Patrick TombezandGitHub 93ef3779d8 Merge pull request #207 from p-tombez/mig14_monitoring_statsd
[MIG] monitoring_statsd: Migration to 14.0
2020-11-03 15:49:50 +01:00
Patrick TombezandGitHub 3f08fe3a59 Merge pull request #208 from p-tombez/mig14_monitoring_status
[MIG] monitoring_status: Migration to 14.0
2020-11-03 15:49:08 +01:00
Patrick Tombez 5f5d75e755 [MIG] logging_json: Migration to 14.0 2020-11-03 15:40:25 +01:00
Patrick Tombez 4897d853a0 [MIG] session_redis: Migration to 14.0 2020-11-03 15:40:07 +01:00
Patrick Tombez aebb9af37b [MIG] monitoring_statsd: Migration to 14.0 2020-11-03 15:39:48 +01:00
Patrick Tombez e2e65c7ee4 [MIG] monitoring_status: Migration to 14.0 2020-11-03 15:39:24 +01:00
Patrick TombezandGitHub d1bf3fff7b Merge pull request #210 from p-tombez/mig14_attachments
[MIG] attachment modules: Migration to 14.0
2020-11-03 15:37:52 +01:00
Patrick Tombez 718c0372c0 [MIG] base_fileurl_field: Migration to 14.0 2020-11-03 15:30:48 +01:00
Patrick Tombez 4d665d96c1 [MIG] base_attachment_object_storage: Migration to 14.0 2020-11-03 15:30:48 +01:00
Patrick Tombez 3655bce3ae [MIG] attachment_swift: Migration to 14.0 2020-11-03 15:30:48 +01:00
Patrick Tombez 049205e560 [MIG] attachment_s3: Migration to 14.0 2020-11-03 15:30:48 +01:00
Patrick TombezandGitHub 3b09ff6f9d Merge pull request #209 from p-tombez/mig14_base
[MIG] base: Migration to 14.0
2020-11-03 11:32:09 +01:00
Patrick Tombez 50b4c15119 [MIG] base: Migration to 14.0 2020-11-03 11:08:55 +01:00
Denis Leemann 287332576a Set module for 14.0 uninstallable 2020-10-06 10:54:24 +02:00
Stéphane ManginandGitHub af8cee48fb Merge pull request #196 from camptocamp/revert-195-attachement_s3_fix
[13.0] attachement_s3: odoo.modules.registry class name and API changed
2020-08-24 16:09:54 +02:00
Stéphane Mangin 2794dc1d96 [13.0] attachement_s3: odoo.modules.registry class name and API changed 2020-08-24 14:15:42 +02:00
Stéphane ManginandGitHub 096c870440 Revert "[13.0] attachement_s3: odoo.modules.registry class name changed" 2020-08-24 13:45:08 +02:00
Stéphane ManginandGitHub 84fed90419 Merge pull request #195 from StephaneMangin/attachement_s3_fix
[13.0] attachement_s3: odoo.modules.registry class name changed
2020-08-24 12:25:05 +02:00
Stéphane Mangin 1069c8f932 [FIX] attachement_s3: odoo.modules.registry class name changed 2020-08-24 12:11:33 +02:00
Guewen BaconnierandGitHub 298050ba52 Merge pull request #191 from guewen/13.0-log-user-id-uuid
[13.0] Extend json logger with request uuid and user id
2020-06-22 13:36:59 +02:00
Stéphane BidoulandGuewen Baconnier 522937c3b5 Log uid 2020-06-22 07:50:44 +02:00
Stéphane BidoulandGuewen Baconnier 9cf4bf2171 Log request uuid 2020-06-22 07:50:35 +02:00
Akim JuilleratandGuewen Baconnier 11c90c5a17 [FIX] attachment_s3: Close fileobjects after usage 2020-06-22 07:46:16 +02:00
Akim JuilleratandGuewen Baconnier c89bfc83e0 [IMP] attachment_s3: Consider bin_size context key
When bin_size context key is set, read operations on attachments
are supposed to return the size of the attachment and not its content
2020-06-22 07:46:05 +02:00
Guewen Baconnier fd335d89be Upgrade setuptools files 2020-06-22 07:23:56 +02:00
Guewen Baconnier bc7d37d465 Ignore .eggs/ in gitignore 2020-06-22 07:22:45 +02:00
Laurent Mignon (ACSONE)andGuewen Baconnier e6f0a82a52 [FIX] logging_json: define dependency override 2020-06-22 07:22:39 +02:00
Guewen BaconnierandGitHub 787a64178f Merge pull request #183 from avoinsystems/13.0-redis-by-url
[13.0][IMP] session_redis: allow configuring Redis URL instead of host & port.
2020-05-28 20:45:56 +02:00
Guewen BaconnierandGitHub dcc809d450 Merge pull request #187 from guewen/13.0-fix-force-storage-db
[13.0] Rework and fix storage forced in database
2020-05-28 11:40:14 +02:00
Guewen Baconnier e3e3899143 Rework and fix storage forced in database
The initial issue that triggered this rework is that the forced storage in
database was working only on writes, and was never applied on attachment
creations.

This feature is used to store small files that need to be read in a fast way in
database rather than in the object storage. Reading a file from the object
storage can take 150-200ms, which is fine for downloading a PDF file or a single
image, but not if you need 40 thumbnails.

Down the path to make a correction, I found that:

* the logic to force storage was called in `_inverse_datas`, which is not called
  during a create
* odoo implemented a new method `_get_datas_related_values`, which is a model
  method that receive only the data and the mimetype, and return the attachment
  values and write the file to the correct place

The `_get_datas_related_values` is where we want to plug this special storage,
as it is called for create and write, and already handle the values and
conditional write. But using this method, we have less information than before
about the attachment, so let's review the different criterias we had before:

* res_model: we were using it to always store attachments related to
  'ir.ui.view' in db, because assets are related to this model. However, we
  don't really need to check this: we should store any javascript and css
  documents in database.
* exclude res_model: we could have an exclusion list, to tell that for instance,
  for mail.message, we should never store any image in db. We don't have this
  information anymore, but I think it was never used and added "in case of".
  Because the default configuration is "mail.mail" and "mail.message" and I
  couldn't find any attachment with such res_model in any of our biggest
  databases. So this is removed.
* mimetype and data (size) are the last criteria and we still have them

The new system is only based on mimetype and data size and I think it's actually
more versatile. Previously, we could set a global size and include mimetypes,
but we couldn't say "I want to store all images below 50KB and all files of type
X below 10KB". Now, we have a single system parameter with a dict configuration
(`ir_attachment.storage.force.database`) defaulting to:

    {"image/": 51200, "application/javascript": 0, "text/css": 0}

Assets have a limit of zero, which means they will all be stored in the database
whatever their size is.

Overall, this is a great simplification of the module too, as the method
`_get_datas_related_values` integrates it better in the base calls of IrAttachment.

Note for upgrade:

I doubt we customized the previous system parameters which are now obsolete, but
if yes, the configuration may need to be moved to `ir_attachment.storage.force.database`.
For the record, the params were:

* mimetypes.list.storedb (default: image)
* file.maxsize.storedb (default: 51200)
* excluded.models.storedb (mail.message,mail.mail), no equivalent now

The method IrAttachment.force_storage_to_db_for_special_fields() should be called
through a migration script on existing databases to move the attachments back into
the database.
2020-05-28 07:26:42 +02:00
Guewen BaconnierandGitHub a2e4c8fc65 Merge pull request #178 from guewen/13.0-redis-json-encode-date
Encode/decode date and datetime in redis sessions
2020-05-26 10:43:47 +02:00
Miku Laitinen a383b45f57 [IMP] session_redis: allow configuring Redis URL instead of host & port. 2020-05-14 18:16:55 +03:00
Guewen BaconnierandGitHub 0769d3b47e Merge pull request #181 from guewen/13.0-fix-server-env
[13.0] Fix build after changes in server_environment
2020-05-11 09:39:53 +02:00