summaryrefslogtreecommitdiff
path: root/doc/reference
diff options
context:
space:
mode:
authorAtul Patel <atp@openerp.com>2017-11-05 23:35:55 +0530
committerXavier Morel <xmo@odoo.com>2018-07-18 16:56:47 +0200
commitdb403e6dd70e14e7275a955a84e8aab607c4711d (patch)
tree29134ca2fea69a440492633061be3fb2fd7a5302 /doc/reference
parentbbbefd70cbf813a823166cb888366e886d8d317e (diff)
[IMP] base_import: Import images via URL
Task 32132 Currently, importing image requires either uploading them one-by-one (after the initial import), scripting that upload, or converting all images to base64 and putting that in the import file (leading to a huge unreadable file) before actually doing the import. This is problematic for non-technical users, especially when they're deploying or synchronising e-commerce products. This change matches URLs in image fields and goes to read the URL & load that as image data. It performs the read inline which is reactive but means the imports will be very slow (wallclock) as each URL will have to be fetched and encoded. Configuration: via config file only * import_image_timeout (seconds, default 3), initial connection timeout (not overall file download) * import_image_maxbytes (bytes, default 10MB): maximum image size to download, checked before download (Content-Length) and validated during (in case Content-Length is missing) * import_image_regex (str), matches field content as "probably an image", by default checks that the field value starts with http|https and ends with an image-type extension (e.g. bmp, png, jpg) Hard Limits: * only works on fields actually called "icon", "image", "logo" or "picture" * the image can't be more than 42MP (checked after all data is downloaded) Hooks: * _can_import_remote_urls (on res.users) checks whether the current user is allowed to import via URLs * _import_image_by_url (on base_import.import) performs the actual download, could be overridden to store urls to import and batch/queue the actual imports
Diffstat (limited to 'doc/reference')
0 files changed, 0 insertions, 0 deletions