EP-25: What is the Difference Between Image & Binary Field in Odoo 18 | Odoo 18 Development Tutorial

Subscribers:
31,300
Published on ● Video Link: https://www.youtube.com/watch?v=9KrpMBRXKuo



Duration: 0:00
48 views
2


The two field definitions, image_1920 = fields.Image(string="Student Image") and image_1920 = fields.Binary(string="Student Image"), both serve the purpose of storing image data in an Odoo model, but they have some key differences in how they are intended to be used and how Odoo handles them by default.

Here's a breakdown of the distinctions:

fields.Image(string="Student Image")

Intended for Images: This field is specifically designed for storing image data. Odoo's framework and web interface are optimized to handle fields of this type as images.
Automatic Resizing (Optional): The fields.Image field often comes with built-in support (or easy configuration) for automatic image resizing to different standard sizes (e.g., thumbnails, small previews, large versions). You might see related fields like image_128, image_256, etc., being automatically populated or easily accessible. The max_width and max_height attributes in the field definition (as seen in some examples) control the maximum dimensions of the stored image.
Widget: When displayed in Odoo's forms and views, fields.Image will typically use the image widget by default, providing a user-friendly interface for uploading and viewing images.
Data Storage: Underneath, the image data is stored as a binary (base64 encoded) string in the database, similar to fields.Binary.
Convenience: It offers a more semantic way to define an image field, and Odoo often provides utilities and conventions around fields.Image for common image-related tasks.
fields.Binary(string="Student Image")

General Binary Data: This is a more general-purpose field for storing any kind of binary data, not just images. This could include documents (PDF, Word), audio files, videos, or any other type of file.
No Automatic Resizing: fields.Binary does not inherently provide automatic image resizing. You would need to implement such functionality manually if required.
Widget: The default widget for a fields.Binary field is a file upload control. To display an image stored in a fields.Binary field as an image in the user interface, you would typically need to explicitly specify the image widget in the view definition.
Flexibility: It's more flexible as it can handle various file types. However, you lose some of the image-specific conveniences offered by fields.Image.
Data Storage: Like fields.Image, the data is stored as a binary (base64 encoded) string in the database.

#Odoo18 #OdooDevelopment #BinaryVsImage #OdooTechnical #Odoo18Features #OdooTutorials #OdooDevTips #OdooRelease #ERPDevelopment #OdooCommunity
#Odoo18Development #Odoo18Technical #Odoo18Tutorial #ImageField #BinaryField #OdooERP #Odoo18NewFeatures #Odoo18Tips #OdooTraining #OdooDeveloper #Python #PostgreSQL #Database #SoftwareDevelopment #ERP #BusinessSoftware #Odoo18Community #OdooExperience

Connect With Us:
—————————————
➡ ️ Websitehttps://www.cybrosys.com/m/
➡ ️ Email: info@cybrosys.com
➡ ️ Twihttps://twitter.com/cybrosysosys  
➡ ️ Lihttps://www.linkedin.com/company/cybrosys/brosys  
➡ ️ https://www.facebook.com/cybrosystechnologiesnologies  
➡ ️ https://www.instagram.com/cybrosystech/brosystech  
https://pinterest.com/cybrosys/  / cybrosys  




Other Videos By Cybrosys Technologies


2025-05-27How to Upsell & Crossell in Odoo 19 POS | Upselling & Crosselling in Odoo 19 POS | Odoo 19 POS
2025-05-27EP-26 How to Add Image Field in Odoo 18 Form View | Binary Field in Odoo |Odoo 18 Technical Tutorial
2025-05-27Odoo 18 Webinar for the Trading Company | Odoo 18 Functional Webinar | Odoo 18 Webinar | Odoo 18
2025-05-26How to Add Bank Account in Odoo 19 | Odoo 19 Accounting Tutorials | Odoo 19 New Features | Odoo 19
2025-05-26Price Comparison of Product in Odoo 19 Purchase | Odoo 19 Purchase Tutorials | Odoo 19 New Features
2025-05-25How to Set Security for Signature in Odoo 19 | Odoo 19 Signature Tutorials | Odoo 19 New Features
2025-05-25How to Create a Lead From a Business Card in Odoo 19 | Import Business Card in Odoo 19 | Odoo 19
2025-05-24How to Set Up No Validation in Odoo 18 Time Off Types | Odoo 18 Time Off Tutorials |Odoo 18 Features
2025-05-24Contact Statistics in Odoo 19 | Odoo 19 Accounting Tutorials | Odoo 19 New Features |Odoo 19 Release
2025-05-23How to Automate Quality Checks in Odoo 18 Quality App | Quality Control Points in Odoo 18 | Odoo 18
2025-05-22EP-25: What is the Difference Between Image & Binary Field in Odoo 18 | Odoo 18 Development Tutorial
2025-05-22How to Manage Performance in Odoo 18 e-Commerce | Odoo 18 Performance Management |Odoo 18 e-Commerce
2025-05-22How to Create Shift in Odoo 18 Planning | Odoo 18 Planning Tutorial | Odoo 18 Features | Odoo 18
2025-05-21How We Can Auto Plan the Open Shift in Odoo 18 Planning | Odoo 18 Planning Tutorials | Odoo 18
2025-05-21How to create a Pass-Fail quality check in Odoo 18 Quality | Odoo 18 Quality App Tutorials | Odoo 18
2025-05-20EP-24 How to Hide a Field in Form View in Odoo 18 | Make Field Invisible Based on Other Fields
2025-05-20Employee Retention in Odoo 18 |How to Analyze Employee Retention Rate in Odoo 18| Employee Reporting
2025-05-19How to Activate Developer Mode in Odoo 18 | Odoo 18 Tutorials | Odoo 18 Developer Tools | Odoo 18
2025-05-19Talks, Proposals & Agenda in Odoo 18 Events | Odoo 18 Event Tutorials | Odoo 18 Functional Tutorial
2025-05-18How to Expand Shift in Odoo 18 Planning | Odoo 18 Planning Tutorials | Odoo 18 Functional Tutorials
2025-05-17How to Restrict Link Access of a Course in Odoo 19 | Odoo 19 New Features | Odoo 19 eLearning Videos