Search 1.9 billion lines of Odoo code on GitHub

base_attachment_object_storage

Author: Camptocamp,Odoo Community Association (OCA)
License: AGPL-3
Branch: 16.0
Repository: vrenaville/odoo-cloud-platform
Dependencies: base
Languages: Python (312, 88.6%), XML (7, 2.0%), and reStructuredText (33, 9.4%)
Other branches: 10.0, 100fix_split, 11.0, 110fix_split, 12.0, 13.0, 130fix_split, 140fix_split, 14_fix_parameters, 14_isra_s3, 14fix_dupplicate, 150fix_split, 15fix_dupplicate, 7.0, 8.0, 9.0, 9.0-monitoring_check_db_connection, 90_fix_running_env, 9_azure_backport, add_identity, azure70, azuremig, consolidated_16, delivery_carrier, denis_v13, fix_after, fix_attachment_result, fix_container_creation, fix_container_creation10, fix_container_creation11, fix_container_creation12, fix_container_creation14, fix_create_container, fix_data_out, fix_dispatch, fix_instance_profile, fix_map_parameter, fix_module_name, fix_param_origin, fix_parameter_origin, fix_read_azure, fix_split_12, imp_db_storage, imp_store_to_db, kwkhtmlbumgél, merge-branch-1151-12.0.1.1.0, merge-branch-1151-12.0.1.2.0, merge-branch-1151-135_update_project_and_submodules-4b5c59d2, merge-branch-1151-79_install_migrated_modules-263768bc, merge-branch-1151-79_install_migrated_modules-a314611d, merge-branch-1151-BSQOQ12-78-263768bc, merge-branch-1151-BSQOQ12-78-a59e0754, merge-branch-1151-BSQOQ12-78-c8f9399f, merge-branch-1151-master, merge-branch-1305-master, merge-branch-1674-8.0.0.0.1, merge-branch-1674-8.0.0.0.2, merge-branch-1674-legacy-4665808d, merge-branch-1674-legacy-92b0cc25, merge-branch-1955-12.0-04330cea, merge-branch-1955-12.0-b19bf503, merge-branch-1955-13_initialize_branch_v12-06a09553, merge-branch-2176-11.0.0, merge-branch-2176-11.0.1, merge-branch-2176-11.0.3, merge-branch-2176-11.1.0, merge-branch-2176-11.2.0, merge-branch-2176-master, merge-branch-2221-fix-swift-14021d9d, merge-branch-2221-ovh-56-qty-received-scenario-8d7505aa, merge-branch-2221-update_submodules_for_travis-9fd09271, merge-branch-2258-12.1.1, merge-branch-2258-12.1.2, merge-branch-2258-add_odoo_cloud_platform-3acc3ca7, merge-branch-2258-master, merge-branch-2477-12.0.0.1.0, merge-branch-2477-12.0.1.0.0, merge-branch-2477-12.0.1.1.0, merge-branch-2477-12.0.1.2.0, merge-branch-2477-12.0.1.2.1, merge-branch-2477-13.0-init-c2f22125, merge-branch-2477-13.0-init2-da62cb54, merge-branch-2477-master-23e1b9ac, merge-branch-2477-master-266b01e9, merge-branch-2477-master-7c6dc33f, merge-branch-2543-add-base_fileurl_field-2cd8af10, merge-branch-2543-bsrd-199_update_odoo_cloud_platform-86233f82, merge-branch-2543-bssmb-25_web_url_fields_s3-188365c5, merge-branch-2543-bssmb-25_web_url_fields_s3-2fe4a35d, merge-branch-2543-bssmb-25_web_url_fields_s3-758bda9d, merge-branch-2543-bssmb-25_web_url_fields_s3-830e055f, merge-branch-2543-bssmb-25_web_url_fields_s3-d89c01bb, merge-branch-2543-mig-base_webdb-4436c761, merge-branch-2660-des-74-80_fix_filestore_images-b3ab4f63, merge-branch-2757-13.0.0.1.0, merge-branch-2757-master-6cfa4609, merge-branch-2762-13.0.1.0.0, merge-branch-2762-BSRD-286_Check_odoo-cloud-platform-1de6d1d5, merge-branch-2762-BSRD-286_Check_odoo-cloud-platform-32273415, merge-branch-2762-BSRD-286_Check_odoo-cloud-platform-c3cfd274, merge-branch-559-gste-44-89edcceb, merge-branch-559-gste-44-b88ff338, migration16, rebase_factorpr_commit, revert-101-13.0-monitoring_check_db_connection, setup_11.0, setup_12.0, setup_13.0, setup_14.0, setup_assets, setuptools_1, and webdev
Other repositories: ERPLibre/odoo-cloud-platform, GSLabIt/odoo-cloud-platform, MjAbuz/odoo-cloud-platform, NCS-75/odoo-cloud-platform, PCatinean/odoo-cloud-platform, RL-OtherApps/odoo-cloud-platform, TelmoSenseFly/odoo-cloud-platform, Tonow-c2c/odoo-cloud-platform, Wiserby/odoo-cloud-platform, acarmisc/odoo-cloud-platform, acsone/odoo-cloud-platform, agrista/odoo-cloud-platform, akretion/odoo-cloud-platform, ap-wtioit/odoo-cloud-platform, asiellb/odoo-cloud-platform, avoinsystems/odoo-cloud-platform, camptocamp/odoo-cloud-platform, celm1990/odoo-cloud-platform, cialuo/odoo-cloud-platform, difra/odoo-cloud-platform, exosoftware/c2c-odoo-cloud-platform, grindtildeath/odoo-cloud-platform, guewen/odoo-cloud-platform, gurneyalex/odoo-cloud-platform, hibou-io/camptocamp-cloud-platform, ircodoo/odoo-cloud-platform, itsalgeria/odoo-cloud-platform, junariltd/odoo-cloud-platform, leemannd/odoo-cloud-platform, loftwah/odoo-cloud-platform, modoolar/odoo-cloud-platform, mohamed-helmy/odoo-cloud-platform, mudismud/odoo-cloud-platform, oondeo/odoo-cloud-platform, p-tombez/odoo-cloud-platform, pasgou/odoo-cloud-platform, paulpwo/odoo-cloud-platform, royalline1/odoo-cloud-platform, sadeqamin/odoo-cloud-platform, sbidoul/odoo-cloud-platform, sebalix/odoo-cloud-platform, sebastienbeau/odoo-cloud-platform, simahawk/odoo-cloud-platform, sm2x/odoo-cloud-platform, smussie/odoo-cloud-platform, suningwz/odoo-cloud-platform, tate11/odoo-cloud-platform, tirix/odoo-cloud-platform, tschanzt/odoo-cloud-platform, ursais/odoo-cloud-platform-1, vidtsin/odoo-cloud-platform, wahello/odoo-cloud-platform, xuanox/odoo-cloud-platform, yvaucher/odoo-cloud-platform, and zakiuu/odoo-cloud-platform

<h1 class="title">Base class for attachments on external object store</h1> <p>This is a base addon that regroup common code used by addons targeting specific object store</p> <a name="configuration"></a> <h2>Configuration</h2> <p>Object storage may be slow, and for this reason, we want to store some files in the database whatever.</p> <p>Small images (128, 256) are used in Odoo in list / kanban views. We want them to be fast to read. They are generally &lt; 50KB (default configuration) so they don't take that much space in database, but they'll be read much faster than from the object storage.</p> <p>The assets (application/javascript, text/css) are stored in database as well whatever their size is:</p> <ul class="simple"> <li>a database doesn't have thousands of them</li> <li>of course better for performance</li> <li>better portability of a database: when replicating a production instance for dev, the assets are included</li> </ul> <p>This storage configuration can be modified in the system parameter <code>ir_attachment.storage.force.database</code>, as a JSON value, for instance:</p> <pre> <code>{&quot;image/&quot;: 51200, &quot;application/javascript&quot;: 0, &quot;text/css&quot;: 0}</code> </pre> <p>Where the key is the beginning of the mimetype to configure and the value is the limit in size below which attachments are kept in DB. 0 means no limit.</p> <p>Default configuration means:</p> <ul class="simple"> <li>images mimetypes (image/png, image/jpeg, ...) below 50KB are stored in database</li> <li>application/javascript are stored in database whatever their size</li> <li>text/css are stored in database whatever their size</li> </ul> <a name="disable-attachment-storage-i-o"></a> <h2>Disable attachment storage I/O</h2> <p>Define a environment variable <cite>DISABLE_ATTACHMENT_STORAGE</cite> set to <cite>1</cite> This will prevent any kind of exceptions and read/write on storage attachments.</p>