Commit Graph
297 Commits
Author SHA1 Message Date
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
Guewen Baconnier 9bdd4b6b1d Fix build after changes in server_environment
Now the default env is "test", and we don't need the directory
at all.
See https://github.com/OCA/server-env/pull/44
2020-05-11 08:27:16 +02:00
Guewen Baconnier ac89e923d7 Add (de-)serialization of set objects in sessions 2020-05-11 07:35:05 +02:00
Guewen Baconnier 35fb727d6c Encode/decode date and datetime in redis sessions
In several places, odoo sets a datetime object directly in the
session. It works with the default session handler of odoo which
uses pickle.

But datetime and date are not json serializable by default.

Add custom encoder / decoder to handle them (from
https://github.com/OCA/queue/blob/dc12a6a20ecfd15c5b90f9b089c9a64cf9d8bbe4/queue_job/fields.py#L57-L99)

See the discussion raised by @PCatinean on https://github.com/camptocamp/odoo-cloud-platform/pull/176
2020-05-04 16:09:55 +02:00
Akim JuilleratandGitHub 323158763b Merge pull request #166 from grindtildeath/13.0-fix_auth_to_keystone_v3
[13.0] attachment_swift: Fix authentication to Keystone v3
2020-03-09 13:33:09 +01:00
Akim Juillerat 7bd76d3cd0 Fix authentication to Keystone v3
- Use newer version from python lib.
 - Define project_domain_id + user_domain_id in auth
2020-03-09 13:01:43 +01:00
Akim JuilleratandGitHub 3470cd4667 Merge pull request #147 from grindtildeath/13.0_dev_attachments
[13.0]Require AWS_BUCKETNAME for prod, integration and labs environments only
2020-03-05 10:13:34 +01:00
Akim Juillerat a372cabeb6 Require AWS_BUCKETNAME for prod, integration and labs environments only
AWS_BUCKETNAME is only needed in order to write on the bucket, but
read-only access should be allowed for other environments.

Fixes bug introduced by 6c3b610610
2020-03-05 09:56:09 +01:00
Akim JuilleratandGitHub 99bf5ffef1 Merge pull request #151 from yvaucher/13.0-aws-bucketname-unstructured
[13.0] Add AWS_BUCKETNAME_UNSTRUCTURED to by-pass check
2020-03-05 09:53:36 +01:00
Patrick TombezandGitHub c4691d05a0 Merge pull request #142 from smussie/BSCLOUDFR-6
[13.0] Use keystoneauth v3 for Swift attachments
2020-03-04 10:23:00 +01:00
Mussie SirakandPatrick Tombez 426d7cbe87 Use keystoneauth v3 for Swift attachments 2020-03-04 10:17:02 +01:00