Search 1.9 billion lines of Odoo code on GitHub

base_attachment_object_storage

Author: Camptocamp,Odoo Community Association (OCA)
License: AGPL-3
Branch: 14.0
Repository: avoinsystems/odoo-cloud-platform
Dependencies: base
Languages: Python (266, 88.1%), XML (7, 2.3%), and reStructuredText (29, 9.6%)
Other branches: 10.0, 11.0, 11.0-avoinsystems, 12.0, 12.0-avoinsystems, 13.0, 13.0-avoinsystems, 13.0-fix-bucket-name-format, 13.0-redis-by-url, 15.0, 9.0, merge-branch-1305-master, 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-master-266b01e9, merge-branch-559-gste-44-89edcceb, and merge-branch-559-gste-44-b88ff338
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, 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, vrenaville/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>