SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
How to make a field
widget in odoo 17
Enterprise
Introduction
Enterprise
In this slide we’ll discuss on how to create and override existing
field widget in odoo 17. Custom field widgets allow developers to
enhance user interfaces by adding tailored functionality or
altering the behavior of default widgets. By understanding how
to create and modify these widgets, we can provide more
dynamic and intuitive user experiences. We will explore the steps
involved in defining custom widgets and overriding existing ones
using the updated Owl framework in Odoo 17.
Enterprise
Here we can see an example of creating the count widget which
counts the number of order lines in sale orderline. Initially we
can inherit sale order and add fields to compute the order line
count.
Enterprise
Next, we can add the js file for this field widget. In the JS file, we define
two components: OrderLine Count Popover and OrderLine Count
Widget. The OrderLine Count Widget component renders an icon that,
when clicked, opens a popover displaying the order line count. The
OrderLine Count Popover component is responsible for rendering the
popover content.
Enterprise
Enterprise
The XML template defines the structure and layout of the widget,
including the icon and the popover content.
Enterprise
Enterprise
Now we can add the count widget in odoo’s views by modifying the
XML view definition for the sale order tree view
Enterprise
After defining all files, we can add these files in the manifest file.
Enterprise
After upgrading the module, if we go to the sales module, we can
see the icon added to the tree view and also if we click on it, it will
display the total number of orderliness in that sale order
Enterprise
Next, we can see how to override an existing widget. For that we
can add the code to override the JavaScript file for the Orderline
widget in POS. Here, we patch the Orderline widget to include
additional functionality for discount button.
Enterprise
We override the widget for the Orderline when applying a discount. If
the discount exceeds 50%, a confirmation popup should appear to
verify the discount. To achieve this, we import the Confirm Popup
widget. We then override the set_discount() method, which is
responsible for setting the product discount, to include the
confirmation logic.
Enterprise
After choosing products and if we give discount more than 50%,
this popup will be shown for confirmation. This is how we
override an existing widget.
For More Info.
Check our company website for related blogs
and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

More Related Content

PPTX
Widgets in odoo
PPTX
How to extend Order, Orderlines , PoS store and model definition in odoo 17 POS
PDF
A Comprehensive Guide to Safe Odoo ERP Customization Practices
PPTX
How to Create a Basic Module in Odoo 17 - Odoo 17 Slides
PPTX
How to Create Manifest File in Odoo 17 ERP
PPTX
How to Create a Progress Bar in Odoo 17 - Odoo 17 Slides
PPTX
Odoo functional tips
PPTX
Position attribute in odoo 17 - Odoo 17 Slides
Widgets in odoo
How to extend Order, Orderlines , PoS store and model definition in odoo 17 POS
A Comprehensive Guide to Safe Odoo ERP Customization Practices
How to Create a Basic Module in Odoo 17 - Odoo 17 Slides
How to Create Manifest File in Odoo 17 ERP
How to Create a Progress Bar in Odoo 17 - Odoo 17 Slides
Odoo functional tips
Position attribute in odoo 17 - Odoo 17 Slides

More from Celine George (20)

PPTX
How to Implement OWL Notification Service in Odoo 18
PPTX
Tracking Profit Margins in Sales Orders with Odoo 18
PPTX
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
PPTX
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
PPTX
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
PPTX
How to Add New Applicants in Odoo 18 Recruitment
PPTX
How to Analyze the Recruitment Process in Odoo 18 Recruitment
PPTX
How to Manage Referral Reporting in Odoo 18 Referrals
PPTX
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PPTX
How to Manage Bill Control Policy in Odoo 18
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
PPTX
Odoo 18 Sales_ Managing Quotation Validity
PPTX
How to Manage Global Discount in Odoo 18 POS
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
How to Implement OWL Notification Service in Odoo 18
Tracking Profit Margins in Sales Orders with Odoo 18
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
How to Add New Applicants in Odoo 18 Recruitment
How to Analyze the Recruitment Process in Odoo 18 Recruitment
How to Manage Referral Reporting in Odoo 18 Referrals
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Revamp in MTO Odoo 18 Inventory - Odoo Slides
How to Manage Starshipit in Odoo 18 - Odoo Slides
How to Manage Bill Control Policy in Odoo 18
How to Manage Loyalty Points in Odoo 18 Sales
Odoo 18 Sales_ Managing Quotation Validity
How to Manage Global Discount in Odoo 18 POS
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Tips Management in Odoo 18 POS - Odoo Slides
How to Close Subscription in Odoo 18 - Odoo Slides
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
How to Track Skills & Contracts Using Odoo 18 Employee
Ad

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Institutional Correction lecture only . . .
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Cell Structure & Organelles in detailed.
PPTX
Cell Types and Its function , kingdom of life
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Lesson notes of climatology university.
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
master seminar digital applications in india
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
RMMM.pdf make it easy to upload and study
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPH.pptx obstetrics and gynecology in nursing
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Sports Quiz easy sports quiz sports quiz
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Cell Structure & Organelles in detailed.
Cell Types and Its function , kingdom of life
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
2.FourierTransform-ShortQuestionswithAnswers.pdf
Lesson notes of climatology university.
Anesthesia in Laparoscopic Surgery in India
master seminar digital applications in india
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Ad

How to make a field widget in odoo 17 - Odoo Slides

  • 1. How to make a field widget in odoo 17 Enterprise
  • 2. Introduction Enterprise In this slide we’ll discuss on how to create and override existing field widget in odoo 17. Custom field widgets allow developers to enhance user interfaces by adding tailored functionality or altering the behavior of default widgets. By understanding how to create and modify these widgets, we can provide more dynamic and intuitive user experiences. We will explore the steps involved in defining custom widgets and overriding existing ones using the updated Owl framework in Odoo 17.
  • 3. Enterprise Here we can see an example of creating the count widget which counts the number of order lines in sale orderline. Initially we can inherit sale order and add fields to compute the order line count.
  • 4. Enterprise Next, we can add the js file for this field widget. In the JS file, we define two components: OrderLine Count Popover and OrderLine Count Widget. The OrderLine Count Widget component renders an icon that, when clicked, opens a popover displaying the order line count. The OrderLine Count Popover component is responsible for rendering the popover content.
  • 6. Enterprise The XML template defines the structure and layout of the widget, including the icon and the popover content.
  • 8. Enterprise Now we can add the count widget in odoo’s views by modifying the XML view definition for the sale order tree view
  • 9. Enterprise After defining all files, we can add these files in the manifest file.
  • 10. Enterprise After upgrading the module, if we go to the sales module, we can see the icon added to the tree view and also if we click on it, it will display the total number of orderliness in that sale order
  • 11. Enterprise Next, we can see how to override an existing widget. For that we can add the code to override the JavaScript file for the Orderline widget in POS. Here, we patch the Orderline widget to include additional functionality for discount button.
  • 12. Enterprise We override the widget for the Orderline when applying a discount. If the discount exceeds 50%, a confirmation popup should appear to verify the discount. To achieve this, we import the Confirm Popup widget. We then override the set_discount() method, which is responsible for setting the product discount, to include the confirmation logic.
  • 13. Enterprise After choosing products and if we give discount more than 50%, this popup will be shown for confirmation. This is how we override an existing widget.
  • 14. For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com