Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 912 |
Technical Name |
eis_drag_drop |
License | OPL-1 |
Website | https://www.expertpk.com |
Versions | 16.0 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 912 |
Technical Name |
eis_drag_drop |
License | OPL-1 |
Website | https://www.expertpk.com |
Versions | 16.0 17.0 18.0 |
Images Drag And Drop Widgets
Effortlessly manage and update images in your Odoo records with our intuitive drag and drop widgets.
Introduction
The Images Drag And Drop Widgets module is a state-of-the-art solution designed to enhance your Odoo experience by integrating modern, user-friendly drag and drop image widgets.
Who Can Benefit?
Whether you run an e-commerce site, a media portal, a real estate listing platform, or any business that requires the handling of multiple images per record, this module is built for you. Enjoy:
- E-commerce websites: Easily manage product images with a simple drag and drop interface.
- Businesses with heavy media content: Quickly update portfolios, galleries, and listings.
- Developers and Designers: Seamlessly integrate modern widgets across all modules—no extra dependency required!
Use Cases
Online Stores: Showcase products with multiple images that can be easily updated on-the-fly.
Real Estate Platforms: Effortlessly manage property photos, floor plans, and virtual tours.
Agencies & Portfolios: Create visually appealing portfolios where media speaks louder than words.
Benefits
With our module, say goodbye to tedious file uploads and hello to a more engaging user experience. It’s simple, robust, and designed to boost your productivity!
Installation
Follow these detailed steps to install the eis_drag_drop module:
- Download the Module: Obtain the module as a ZIP file from the official repository or your vendor.
- Extract the ZIP: Unzip the downloaded file to reveal the module folder.
-
Copy to Addons Folder:
Move or copy the extracted
module folder into your Odoo
addons
directory. -
Restart Odoo Service:
-
On systemd-based systems:
sudo systemctl restart odoo
-
On SysVinit-based systems:
sudo service odoo restart
- Or use the appropriate command for your OS.
-
On systemd-based systems:
- Update App List: In your Odoo database, navigate to the Apps menu and click Update Apps List.
-
Install the Module:
Search for
Drag and Drop Widgets
(or
eis_drag_drop
) and click install.
User Guide
Updating Existing Image Fields
You can update any existing binary image field to use our drag and drop widget without altering your custom modules. Simply update your XML views by setting the widget attribute to:
<field name="image_field" widget="d_and_d_image" options="{
"image_size": "150x150",
"preview_image": "image_128",
"acceptedFileExtensions": "image/*",
"enableZoom": true,
"additionalStyles": "border:2px solid #007bff;"
}>
</field>
Options Explained:
-
image_size
: Defines the display size of the widget. Example: "150x150" sets the width to 150px and height to 150px. -
preview_image
: Specifies the field used for the image preview. If not set, it defaults to the binary field name. -
acceptedFileExtensions
: Determines which image formats can be uploaded. -
enableZoom
: If true, hovering over the image displays a zoom popup. -
additionalStyles
: Custom CSS styles that are appended to the widget's inline styles.
Detailed O2M Setup & Custom Integration
For One2Many fields, our widget transforms the standard image upload
into a dynamic drag and drop area.
Note:
The related model
must
have a Kanban
view defined that includes at least the
name
and
image
(or image_1920
) fields.
Why a Kanban View? The Kanban view enables the widget to render image previews instead of just record IDs. Without it, you may only see numerical identifiers.
Form View for Videos & Manual Entry: If you wish to add videos or manually add images in the traditional way, ensure that your One2Many field is also accessible via a form view.
Example of One2Many Field Integration
<page name="media" string="Extra Media">
<field name="media_ids" widget="d_and_d_images"
options="{
'childImageField': 'image_1920',
'extraData': {
'categ_id': 1,
'enable_zoom': true,
'previewImage': 'image_128',
'cssStyles': 'width:150px; height:200px; border-radius:15px;'
}
}"/>
</page>
Options Explained:
-
childImageField
: Specifies the field in the child model where the binary image data is stored. This is mandatory for the widget to function correctly. If not specified, image_1920 will be used. -
extraData
: Allows you to pass additional data to the child records. This can include:-
categ_id
: An example field that sets a default category ID. This feature allows you to add any additional field and its value if your model has a required field and without it, it cannot create new records, or a field that you need to fill with static data. -
sale_ok
: This is another example field and you can pass any bool value if your required field is bool type -
previewImage
: Specifies a smaller image field to use for previews, which is important if you want to show a smaller size image to save bandwidth. This value should be used if your model is inherited fromimage.mixin
and you want to display a smaller preview image. -
cssStyles
: Custom CSS styles for the image display. Example:"width:150px; height:200px; border-radius:15px; object-fit:cover;"
.
-
-
acceptedFileExtensions
: Determines which file types are acceptable for upload. Default is"image/*"
.
User Guide
Updating Existing Image Fields
You can update any existing binary image field to use our drag and drop widget without altering your custom modules. Simply update your XML views by setting the widget attribute to:
<field name="image_field" widget="d_and_d_image" options="{
"image_size": "150x150",
"preview_image": "image_128",
"acceptedFileExtensions": "image/*",
"enableZoom": true,
"additionalStyles": "border:2px solid #007bff;"
}>
</field>
Options Explained:
-
image_size
: Defines the display size of the widget. Example: "150x150" sets the width to 150px and height to 150px. -
preview_image
: Specifies the field used for the image preview. If not set, it defaults to the binary field name. -
acceptedFileExtensions
: Determines which image formats can be uploaded. -
enableZoom
: If true, hovering over the image displays a zoom popup. -
additionalStyles
: Custom CSS styles that are appended to the widget's inline styles.
Detailed O2M Setup & Custom Integration
For One2Many fields, our widget transforms the standard image upload
into a dynamic drag and drop area.
Note:
The related
model
must
have a Kanban view defined that includes at least
the
name
and
image
(or
image_1920
) fields.
Why a Kanban View? The Kanban view enables the widget to render image previews instead of just record IDs. Without it, you may only see numerical identifiers.
Form View for Videos & Manual Entry: If you wish to add videos or manually add images in the traditional way, ensure that your One2Many field is also accessible via a form view.
Example of One2Many Field Integration
<page name="media" string="Extra Media">
<field name="media_ids" widget="d_and_d_images"
options="{
'childImageField': 'image_1920',
'extraData': {
'categ_id': 1,
'enable_zoom': true,
'previewImage': 'image_128',
'cssStyles': 'width:150px; height:200px; border-radius:15px;'
}
}"/>
</page>
Options Explained:
-
childImageField
: Specifies the field in the child model where the binary image data is stored. This is mandatory for the widget to function correctly. If not specified,image_1920
will be used. -
extraData
: Allows you to pass additional data to the child records. This can include:-
categ_id
: An example field that sets a default category ID. This feature allows you to add any additional field and its value if your model has a required field and without it, it cannot create new records, or a field that you need to fill with static data. -
sale_ok
: This is another example field and you can pass any bool value if your required field is bool type. -
previewImage
: Specifies a smaller image field to use for previews, which is important if you want to show a smaller size image to save bandwidth. This value should be used if your model is inherited fromimage.mixin
and you want to display a smaller preview image. -
cssStyles
: Custom CSS styles for the image display. Example:"width:150px; height:200px; border-radius:15px; object-fit:cover;"
.
-
-
acceptedFileExtensions
: Determines which file types are acceptable for upload. Default is"image/*"
.
Important Notice!
Do not create the models described in the following example. Odoo already includes these models. This example is provided for educational purposes to help you understand the implementation.
Complete Example (Taken from Odoo builtin Code):
Adding Multiple Image Support to
product.template
Let's say we have a model
product.template
and we need to
add multiple image support to it. We will create a model
product.image
by inheriting from the
image.mixin
class. This way, we automatically get fields
like
image_1920
and other related fields for our model
product.image
.
Here are the steps to achieve this:
-
Create the
product.image
Model:Inherit from
image.mixin
to automatically get image-related fields.class ProductImage(models.Model): _name = 'product.image' _inherit = 'image.mixin' product_tmpl_id = fields.Many2one('product.template', string='Product Template') sequence = fields.Integer('Sequence') video_url = fields.Char('Video URL')
-
Extend the
product.template
Model:Add a One2Many field to link multiple images.
class ProductTemplate(models.Model): _inherit = 'product.template' product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string='Images')
-
Create a Kanban View for
product.image
:Add a Kanban view with the necessary fields.
<record id="view_product_image_kanban" model="ir.ui.view"> <field name="name">product.image.kanban</field> <field name="model">product.image</field> <field name="arch" type="xml"> <kanban> <field name="id"/> <field name="name"/> <field name="image_1920" widget="image"/> <field name="sequence"/> </kanban> </field> </record>
-
Create a Form View for
product.image
:Add a form view with fields for video URL and image.
<record id="view_product_image_form" model="ir.ui.view"> <field name="name">product.image.form</field> <field name="model">product.image</field> <field name="arch" type="xml"> <form> <field name="id"/> <field name="name"/> <field name="video_url"/> <field name="image_1920" widget="image"/> </form> </field> </record>
-
Update the
product.template
Form View:Add the One2Many field with the drag-and-drop widget.
<record id="view_product_template_form" model="ir.ui.view"> <field name="name">product.template.form</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_only_form_view"/> <field name="arch" type="xml"> <form> <sheet> <group> <field name="product_template_image_ids" widget="d_and_d_images" options="{ 'childImageField': 'image_1920', 'extraData': { 'cssStyles': 'width:150px;height:150px;' } }"/> </group> </sheet> </form> </field> </record>
This guide outlines the necessary steps for integrating d_and_d_images widget for product
template, specifically when using the
website_sale
module, across Odoo 17 and 18. Please carefully follow the instructions for your respective Odoo
version to avoid conflicts and ensure proper functionality.
Odoo 17:
-
Do not duplicate the
product.image
model or its views. This model is already provided by thewebsite_sale
module in Odoo. Creating a duplicate will lead to conflicts. -
Inherit the
product.template
form view. . You will modify the form viewproduct.product_template_form_view
to integrate d_and_d_images customizations seamlessly with Odoo's core functionality. -
Customize the image field:
Replace the
product_template_image_ids
field in the inherited form view with d_and_d_images widget as described above to enhance the product image management functionality.
Odoo 18:
Odoo 18 has modified the
product.image
Kanban view by removing certain fields. So, to make it compatible again with our d_and_d_images
widghet, here's how to adjust Odoo 18:
-
Inherit the
product.image
Kanban view.website_sale.product_image_view_kanban
. Add the necessaryid
andname
fields back into the view to maintain existing functionality. That's it. -
Enable modifications through the module's manifest:
- Declare dependency on
website_sale
in our eis_drag_drop module's__manifest__.py
file to ensure proper loading order. You jsut need to uncomment the line having website_sale with key depends and then comment the existing depend key. - Reference the XML file containing your Kanban view modifications in the
data
key of the manifest to apply these changes automatically when your module is installed or updated.
- Declare dependency on
-
Alternative approach:
Manually define the Kanban view inheritance in a
product.xml
file if you prefer more direct control over the modifications.
Our module has pre-configured these enhancements for you. To activate them, modify the
__manifest__.py
file to uncomment the dependency on
website_sale
and the reference to
/views/product.xml
in the
data
key. This ensures all functionalities are seamlessly integrated when you install or update the
module.
Screenshots Explaination
Drag and Drop Widget Overview

A clear view of the drag and drop widget areas for single binary image and for one2many images., allowing users to effortlessly update images.
One2Many Drag And Drop Explained

In this screenshot, you can see a simple explaination of the view. Each record's thumbnail, have a small cross on top right corner to remove a record, view also display video thumbnail, and buttons.
Add Video Button

This screenshot illustrates how the one2many field widget
'Add Video'
button is working. You can access odoo
builtin method being used in website_sale module of odoo to add
extra media including videos or images.
Manual File Uploding Button Display

This screenshot illustrates how the one2many field widget manual upload button is working. If you want to upload images manually from file uploader, you can click on this button and it will open finder / file explorer for you. It will only allow images to upload with jpg, jpeg, png, svg etc
Iamges Dragging over One2many Field Display

This screenshot illustrates how the one2many field is being used to drop 4 images into drag drop area. Notice the blue border that is highlighted when we dragged the images over it. As soon as we will drop the images, they will be uploaded automatically
Video Explaination
Drag and Drop Widget Overview
Watch the video to see how it works.
Module Version Information & Changelog
- v1.0.0 - Initial release with basic drag and drop functionality.
- v1.1.0 - Added support for one2many fields and improved preview handling.
- v1.2.0 - Enhanced UI, added zoom popup, and refined installation instructions.
- v1.3.0 - Bug fixes and performance improvements for large image uploads.
-
v1.3.1
- Fixes the situation where the form is dirty and d_and_d_images was discarding changes. in this version it will save the changes.
- A new option added 'showConfirm' in multi image widget d_and_d_images. It is bool field and it will show a configuration dialog to ask for saving changes if form is dirty. the extraData should contain a key 'showConfirm': true, if not provided or is false, the form will saved without confirmation.
- If not passed, default is to save dirty form to preserve changes.
90 Days Support
Our Services
Odoo Development
Build custom Odoo modules and applications tailored to your business needs.
Learn MoreExplore Our Other Modules
Best Practices & Troubleshooting
Best Practices
- Always backup your database before applying new modules.
- Test the module in a staging environment prior to production deployment.
- Ensure that the related one2many models have the required Kanban view with mandatory fields.
- Regularly update your Odoo instance to keep up with security and performance improvements.
Troubleshooting Steps
-
If image previews are not displaying, verify that your Kanban view
contains the
name
andimage
/image_1920
fields. - Check the browser console for JavaScript errors related to the widget.
- Ensure file permissions are correctly set in your addons folder.
- Review the server logs for any errors during file upload or service restart.
Code Snippets
Below are examples of typical XML view definitions where the new drag and drop fields are highlighted:
Single Image Widget
This snippet shows how to integrate a single image drag and drop field into an Odoo form view:
<form string="Product Form">
<sheet>
<group>
<field name="name" />
<field name="description" />
<!-- Our new drag and drop image field is highlighted below -->
<field name="image_1920" widget="d_and_d_image"
class="oe_avator" options="{
"image_size": "200x200",
"preview_image": "image_128",
"acceptedFileExtensions": "image/*",
"enableZoom": true
}" />
<field name="price" />
</group>
</sheet>
</form>
Explanation:
This code defines a form view for a
product. The
product_image
field uses the
d_and_d_image
widget, which allows users to drag and
drop images. The
options
attribute specifies settings
like image size, preview image, accepted file extensions, and zoom
functionality.
One2Many Image Widget
This snippet demonstrates how to integrate a One2Many image drag and drop field into an Odoo form view:
<form string="Product Form">
<sheet>
<group>
<field name="name" />
<field name="description" />
<!-- One2Many drag and drop image field -->
<field name="product_images" widget="d_and_d_images"
options="{
"childImageField": "image_1920",
"extraData": {
"cssStyles": "width:150px;height:150px;"
}
}" />
<field name="price" />
</group>
</sheet>
</form>
Explanation:
This code defines a form view for a
product with a One2Many field product_images
. The
d_and_d_images
widget allows users to drag and drop
multiple images. The
options
attribute specifies the
child image field and additional CSS styles for the image display.
Images Drag And Drop Widgets
Effortlessly manage and update images in your Odoo records with our intuitive drag and drop widgets.
Introduction
The Images Drag And Drop Widgets module is a state-of-the-art solution designed to enhance your Odoo experience by integrating modern, user-friendly drag and drop image widgets.
Who Can Benefit?
Whether you run an e-commerce site, a media portal, a real estate listing platform, or any business that requires the handling of multiple images per record, this module is built for you. Enjoy:
- E-commerce websites: Easily manage product images with a simple drag and drop interface.
- Businesses with heavy media content: Quickly update portfolios, galleries, and listings.
- Developers and Designers: Seamlessly integrate modern widgets across all modules—no extra dependency required!
Use Cases
Online Stores: Showcase products with multiple images that can be easily updated on-the-fly.
Real Estate Platforms: Effortlessly manage property photos, floor plans, and virtual tours.
Agencies & Portfolios: Create visually appealing portfolios where media speaks louder than words.
Benefits
With our module, say goodbye to tedious file uploads and hello to a more engaging user experience. It’s simple, robust, and designed to boost your productivity!
Installation
Follow these detailed steps to install the eis_drag_drop module:
- Download the Module: Obtain the module as a ZIP file from the official repository or your vendor.
- Extract the ZIP: Unzip the downloaded file to reveal the module folder.
- Copy to Addons Folder: Move or copy the extracted module folder into your Odoo addons directory.
- Restart Odoo Service:
- On systemd-based systems: sudo systemctl restart odoo
- On SysVinit-based systems: sudo service odoo restart
- Or use the appropriate command for your OS.
- Update App List: In your Odoo database, navigate to the Apps menu and click Update Apps List.
- Install the Module: Search for Drag and Drop Widgets (or eis_drag_drop) and click install.
User Guide
Updating Existing Image Fields
You can update any existing binary image field to use our drag and drop widget without altering your custom modules. Simply update your XML views by setting the widget attribute to:
<field name="image_field" widget="d_and_d_image" options="{ "image_size": "150x150", "preview_image": "image_128", "acceptedFileExtensions": "image/*", "enableZoom": true, "additionalStyles": "border:2px solid #007bff;" }> </field>
Options Explained:
- image_size: Defines the display size of the widget. Example: "150x150" sets the width to 150px and height to 150px.
- preview_image: Specifies the field used for the image preview. If not set, it defaults to the binary field name.
- acceptedFileExtensions: Determines which image formats can be uploaded.
- enableZoom: If true, hovering over the image displays a zoom popup.
- additionalStyles: Custom CSS styles that are appended to the widget's inline styles.
Detailed O2M Setup & Custom Integration
For One2Many fields, our widget transforms the standard image upload into a dynamic drag and drop area. Note: The related model must have a Kanban view defined that includes at least the name and image (or image_1920) fields.
Why a Kanban View? The Kanban view enables the widget to render image previews instead of just record IDs. Without it, you may only see numerical identifiers.
Form View for Videos & Manual Entry: If you wish to add videos or manually add images in the traditional way, ensure that your One2Many field is also accessible via a form view.
Example of One2Many Field Integration
<page name="media" string="Extra Media"> <field name="media_ids" widget="d_and_d_images" options="{ 'childImageField': 'image_1920', 'extraData': { 'categ_id': 1, 'enable_zoom': true, 'previewImage': 'image_128', 'cssStyles': 'width:150px; height:200px; border-radius:15px;' } }"/> </page>
Options Explained:
- childImageField: Specifies the field in the child model where the binary image data is stored. This is mandatory for the widget to function correctly. If not specified, image_1920 will be used.
- extraData: Allows you to pass additional data to the child
records. This can include:
- categ_id: An example field that sets a default category ID. This feature allows you to add any additional field and its value if your model has a required field and without it, it cannot create new records, or a field that you need to fill with static data.
- sale_ok: This is another example field and you can pass any bool value if your required field is bool type
- previewImage: Specifies a smaller image field to use for previews, which is important if you want to show a smaller size image to save bandwidth. This value should be used if your model is inherited from image.mixin and you want to display a smaller preview image.
- cssStyles: Custom CSS styles for the image display. Example: "width:150px; height:200px; border-radius:15px; object-fit:cover;".
- acceptedFileExtensions: Determines which file types are acceptable for upload. Default is "image/*".
User Guide
Updating Existing Image Fields
You can update any existing binary image field to use our drag and drop widget without altering your custom modules. Simply update your XML views by setting the widget attribute to:
<field name="image_field" widget="d_and_d_image" options="{ "image_size": "150x150", "preview_image": "image_128", "acceptedFileExtensions": "image/*", "enableZoom": true, "additionalStyles": "border:2px solid #007bff;" }> </field>
Options Explained:
- image_size: Defines the display size of the widget. Example: "150x150" sets the width to 150px and height to 150px.
- preview_image: Specifies the field used for the image preview. If not set, it defaults to the binary field name.
- acceptedFileExtensions: Determines which image formats can be uploaded.
- enableZoom: If true, hovering over the image displays a zoom popup.
- additionalStyles: Custom CSS styles that are appended to the widget's inline styles.
Detailed O2M Setup & Custom Integration
For One2Many fields, our widget transforms the standard image upload into a dynamic drag and drop area. Note: The related model must have a Kanban view defined that includes at least the name and image (or image_1920) fields.
Why a Kanban View? The Kanban view enables the widget to render image previews instead of just record IDs. Without it, you may only see numerical identifiers.
Form View for Videos & Manual Entry: If you wish to add videos or manually add images in the traditional way, ensure that your One2Many field is also accessible via a form view.
Example of One2Many Field Integration
<page name="media" string="Extra Media"> <field name="media_ids" widget="d_and_d_images" options="{ 'childImageField': 'image_1920', 'extraData': { 'categ_id': 1, 'enable_zoom': true, 'previewImage': 'image_128', 'cssStyles': 'width:150px; height:200px; border-radius:15px;' } }"/> </page>
Options Explained:
- childImageField: Specifies the field in the child model where the binary image data is stored. This is mandatory for the widget to function correctly. If not specified, image_1920 will be used.
- extraData: Allows you to pass additional data to the child
records. This can include:
- categ_id: An example field that sets a default category ID. This feature allows you to add any additional field and its value if your model has a required field and without it, it cannot create new records, or a field that you need to fill with static data.
- sale_ok: This is another example field and you can pass any bool value if your required field is bool type.
- previewImage: Specifies a smaller image field to use for previews, which is important if you want to show a smaller size image to save bandwidth. This value should be used if your model is inherited from image.mixin and you want to display a smaller preview image.
- cssStyles: Custom CSS styles for the image display. Example: "width:150px; height:200px; border-radius:15px; object-fit:cover;".
- acceptedFileExtensions: Determines which file types are acceptable for upload. Default is "image/*".
Important Notice!
Do not create the models described in the following example. Odoo already includes these models. This example is provided for educational purposes to help you understand the implementation.
Complete Example (Taken from Odoo builtin Code):
Adding Multiple Image Support to product.template
Let's say we have a model product.template and we need to add multiple image support to it. We will create a model product.image by inheriting from the image.mixin class. This way, we automatically get fields like image_1920 and other related fields for our model product.image.
Here are the steps to achieve this:
Create the ``product.image`` Model:
Inherit from image.mixin to automatically get image-related fields.
class ProductImage(models.Model): _name = 'product.image' _inherit = 'image.mixin' product_tmpl_id = fields.Many2one('product.template', string='Product Template') sequence = fields.Integer('Sequence') video_url = fields.Char('Video URL')
Extend the ``product.template`` Model:
Add a One2Many field to link multiple images.
class ProductTemplate(models.Model): _inherit = 'product.template' product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string='Images')
Create a Kanban View for ``product.image``:
Add a Kanban view with the necessary fields.
<record id="view_product_image_kanban" model="ir.ui.view"> <field name="name">product.image.kanban</field> <field name="model">product.image</field> <field name="arch" type="xml"> <kanban> <field name="id"/> <field name="name"/> <field name="image_1920" widget="image"/> <field name="sequence"/> </kanban> </field> </record>
Create a Form View for ``product.image``:
Add a form view with fields for video URL and image.
<record id="view_product_image_form" model="ir.ui.view"> <field name="name">product.image.form</field> <field name="model">product.image</field> <field name="arch" type="xml"> <form> <field name="id"/> <field name="name"/> <field name="video_url"/> <field name="image_1920" widget="image"/> </form> </field> </record>
Update the ``product.template`` Form View:
Add the One2Many field with the drag-and-drop widget.
<record id="view_product_template_form" model="ir.ui.view"> <field name="name">product.template.form</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_only_form_view"/> <field name="arch" type="xml"> <form> <sheet> <group> <field name="product_template_image_ids" widget="d_and_d_images" options="{ 'childImageField': 'image_1920', 'extraData': { 'cssStyles': 'width:150px;height:150px;' } }"/> </group> </sheet> </form> </field> </record>
Important Considerations for Product Image Management (Odoo 17 and 18) This guide outlines the necessary steps for integrating d_and_d_images widget for product template, specifically when using the website_sale module, across Odoo 17 and 18. Please carefully follow the instructions for your respective Odoo version to avoid conflicts and ensure proper functionality.
Odoo 17:
- Do not duplicate the ``product.image`` model or its views. This model is already provided by the website_sale module in Odoo. Creating a duplicate will lead to conflicts.
- Inherit the ``product.template`` form view.. You will modify the form view product.product_template_form_view to integrate d_and_d_images customizations seamlessly with Odoo's core functionality.
- Customize the image field: Replace the product_template_image_ids field in the inherited form view with d_and_d_images widget as described above to enhance the product image management functionality.
Odoo 18:
Odoo 18 has modified the product.image Kanban view by removing certain fields. So, to make it compatible again with our d_and_d_images widghet, here's how to adjust Odoo 18:
- Inherit the ``product.image`` Kanban view. website_sale.product_image_view_kanban. Add the necessary id and name fields back into the view to maintain existing functionality. That's it.
- Enable modifications through the module's manifest:
- Declare dependency on website_sale in our eis_drag_drop module's __manifest__.py file to ensure proper loading order. You jsut need to uncomment the line having website_sale with key depends and then comment the existing depend key.
- Reference the XML file containing your Kanban view modifications in the data key of the manifest to apply these changes automatically when your module is installed or updated.
- Alternative approach: Manually define the Kanban view inheritance in a product.xml file if you prefer more direct control over the modifications.
Our module has pre-configured these enhancements for you. To activate them, modify the __manifest__.py file to uncomment the dependency on website_sale and the reference to /views/product.xml in the data key. This ensures all functionalities are seamlessly integrated when you install or update the module.
Screenshots Explaination
Drag and Drop Widget Overview
A clear view of the drag and drop widget areas for single
binary image and for one2many images., allowing users to
effortlessly update images.
One2Many Drag And Drop Explained
In this screenshot, you can see a simple explaination of the
view. Each record's thumbnail, have a small cross on top right
corner to remove a record, view also display video thumbnail,
and buttons.
Add Video Button
This screenshot illustrates how the one2many field widget
'Add Video' button is working. You can access odoo builtin
method being used in website_sale module of odoo to add extra
media including videos or images.
Manual File Uploding Button Display
This screenshot illustrates how the one2many field widget
manual upload button is working. If you want to upload images
manually from file uploader, you can click on this button and
it will open finder / file explorer for you. It will only allow
images to upload with jpg, jpeg, png, svg etc
Iamges Dragging over One2many Field Display
This screenshot illustrates how the one2many field is being
used to drop 4 images into drag drop area. Notice the blue
border that is highlighted when we dragged the images over it.
As soon as we will drop the images, they will be uploaded
automatically
Video Explaination
Drag and Drop Widget Overview
Watch the video to see how it works.
Module Version Information & Changelog
- v1.0.0 - Initial release with basic drag and drop functionality.
- v1.1.0 - Added support for one2many fields and improved preview handling.
- v1.2.0 - Enhanced UI, added zoom popup, and refined installation instructions.
- v1.3.0 - Bug fixes and performance improvements for large image uploads.
- v1.3.1 - New feature added to save dirty form to preserver new changes.
- 1: - add new key 'showConfirm' in extraData, it is bool value. it will show a confirmation dialog to ask user to save changes in form or not.
- 2: - If no option given, the default is true.
90 Days Support
Our Services
Odoo Development
Build custom Odoo modules and applications tailored to your business needs.
Explore Our Other Modules
Best Practices & Troubleshooting
Best Practices
- Always backup your database before applying new modules.
- Test the module in a staging environment prior to production deployment.
- Ensure that the related one2many models have the required Kanban view with mandatory fields.
- Regularly update your Odoo instance to keep up with security and performance improvements.
Troubleshooting Steps
- If image previews are not displaying, verify that your Kanban view contains the name and image/image_1920 fields.
- Check the browser console for JavaScript errors related to the widget.
- Ensure file permissions are correctly set in your addons folder.
- Review the server logs for any errors during file upload or service restart.
Code Snippets
Below are examples of typical XML view definitions where the new drag and drop fields are highlighted:
Single Image Widget
This snippet shows how to integrate a single image drag and drop field into an Odoo form view:
<form string="Product Form"> <sheet> <group> <field name="name" /> <field name="description" /> <!-- Our new drag and drop image field is highlighted below --> <field name="image_1920" widget="d_and_d_image" class="oe_avator" options="{ "image_size": "200x200", "preview_image": "image_128", "acceptedFileExtensions": "image/*", "enableZoom": true }" /> <field name="price" /> </group> </sheet> </form>
Explanation: This code defines a form view for a product. The product_image field uses the d_and_d_image widget, which allows users to drag and drop images. The options attribute specifies settings like image size, preview image, accepted file extensions, and zoom functionality.
One2Many Image Widget
This snippet demonstrates how to integrate a One2Many image drag and drop field into an Odoo form view:
<form string="Product Form"> <sheet> <group> <field name="name" /> <field name="description" /> <!-- One2Many drag and drop image field --> <field name="product_images" widget="d_and_d_images" options="{ "childImageField": "image_1920", "extraData": { "cssStyles": "width:150px;height:150px;" } }" /> <field name="price" /> </group> </sheet> </form>
Explanation: This code defines a form view for a product with a One2Many field product_images. The d_and_d_images widget allows users to drag and drop multiple images. The options attribute specifies the child image field and additional CSS styles for the image display.
© 2025 Expert IT Solutions. All rights reserved.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module