| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 898 |
| Technical Name |
mln_drag_drop |
| License | LGPL-3 |
Module icon
mln · Drag Drop Image Gallery
Odoo 18 backend forms: One2many multi-image in one place â
batch upload (drag in several images or multi-select in the file dialog),
zoom preview (click a thumbnail for a full-screen lightbox; close with Esc, backdrop, or the close control),
download (per-image button bottom-left; toolbar Download all (ZIP) for saved lines only).
Use widget="drag_drop_images" in the view; the child model needs an image field and optional name for file name / title.
Core features · Upload · Preview · Download
Batch upload
Drag multiple images into the dashed area, or click Drag or Upload and multi-select in the file dialog;
each image creates one child line. On upload, the original file name is written to child name (define that field on the child model) for list display and download names.
Zoom preview
Click the thumbnail to open a dark overlay lightbox; the large image scales to the window.
Close with Esc, clicking the backdrop, or the à control. Optional enable_zoom adds a slight hover zoom effect.
Download
Single: green circular button bottom-left; triggers save on the current page, same tab (same-origin /web/image).
Bulk: toolbar Download all (ZIP) only packs saved child lines; save the parent form first. ZIP entry names prefer child line name.
Screenshots
Screenshots are shipped as screenshot_2.png and screenshot_2.png in this folder. Replace them before publishing if you want different captures (about 560â900px wide, PNG or JPG).
Figure 1 Gallery: upload / download / ZIP
Typical layout: toolbar Download all (ZIP), per-image download bottom-left / delete à top-right, caption below, Drag or Upload on the right with multi-select.
Figure 2 Alongside other form fields (sample layout)
Works next to Char, Many2one, etc.; suitable for service photos, product attachments, work order galleries, and similar.
Overview
- Widget:
drag_drop_imagesfor One2many fields. - Batch upload: multi-file drag-and-drop or file input
multiple; one child row per image; childnamerecommended for captions. - Zoom preview: click thumbnail for lightbox; Esc and backdrop to close.
- Download: single image without a new tab; bulk ZIP via server (saved child rows, read access).
- Child model: binary / image field (often
image_1920); optionalpreviewImagefor thumbnails. - Theme compatibility: controls use
span role="button"where possible. - Built-in demo: menu mln Drag Drop â Demo.
Quick start · XML example
Child model with an image field (example image_1920) and name (recommended):
<field name="line_ids"
widget="drag_drop_images"
options="{
'childImageField': 'image_1920',
'acceptedFileExtensions': 'image/*',
'extraData': {
'previewImage': 'image_128',
'cssStyles': 'width:120px;height:120px;object-fit:cover;border-radius:8px;',
'enable_zoom': true
}
}"/>
Options summary:
childImageField â child image field (default image_1920).
acceptedFileExtensions â default image/*.
extraData â defaults for new lines; preview/zoom keys are UI-only. Lightbox, single download, and ZIP are built in (ZIP needs saved rows). Full details in README.md.
FAQ
- ZIP button does nothing?
- Bulk ZIP only includes saved child lines. Save the parent form first.
- Captions under thumbnails all say âImageâ?
- Ensure child
nameis writable; upload fills the original file name. - Images visible before save, blank after?
- Check child image field in
relatedFieldsand required fields /extraData. - Delete control not visible?
- Upgrade the module; delete uses a
spanfor theme compatibility. - Migrating from
eis_drag_drop? - Uninstall the old module, then install
mln_drag_drop; seeREADME.md.
mln Drag Drop Gallery · Odoo 18 · LGPL-3
Batch upload · zoom preview · single and ZIP download â see README.md.
Please log in to comment on this module