際際滷

際際滷Share a Scribd company logo
How to make a field
widget in odoo 17
Enterprise
Introduction
Enterprise
In this slide well 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 odoos 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

Similar to How to make a field widget in odoo 17 - Odoo 際際滷s (20)

Salesforce crm projects
Salesforce crm projects Salesforce crm projects
Salesforce crm projects
Advanz Knowledge Systems P Ltd
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
Celine George
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷sHTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
Celine George
How to Add Custom Fields to Configuration Settings in Odoo 17
How to Add Custom Fields to Configuration Settings in Odoo 17How to Add Custom Fields to Configuration Settings in Odoo 17
How to Add Custom Fields to Configuration Settings in Odoo 17
Celine George
How to modify_create components control buttons in Pos odoo.pptx
How to modify_create components control buttons in Pos odoo.pptxHow to modify_create components control buttons in Pos odoo.pptx
How to modify_create components control buttons in Pos odoo.pptx
Celine George
HTML Widgets For Search
HTML Widgets For SearchHTML Widgets For Search
HTML Widgets For Search
Jayesh Bhoyar
How to Create & Configure Server Actions in the Odoo 18
How to Create & Configure Server Actions in the Odoo 18How to Create & Configure Server Actions in the Odoo 18
How to Create & Configure Server Actions in the Odoo 18
Celine George
How to hide the buttons on the POS screen in Odoo 17
How to hide the buttons on the POS screen in Odoo 17How to hide the buttons on the POS screen in Odoo 17
How to hide the buttons on the POS screen in Odoo 17
Celine George
How To Create Record From Code In Odoo 17
How To Create Record From Code In Odoo 17How To Create Record From Code In Odoo 17
How To Create Record From Code In Odoo 17
Celine George
Embellish bureau
Embellish bureauEmbellish bureau
Embellish bureau
siraj10
The EffiChange XPager Suite: Understanding XPages Scaffolding
The EffiChange XPager Suite: Understanding XPages ScaffoldingThe EffiChange XPager Suite: Understanding XPages Scaffolding
The EffiChange XPager Suite: Understanding XPages Scaffolding
EffiChange LLC
New Features in Odoo 17 Website Module - Odoo 17 際際滷s
New Features in Odoo 17 Website Module - Odoo 17 際際滷sNew Features in Odoo 17 Website Module - Odoo 17 際際滷s
New Features in Odoo 17 Website Module - Odoo 17 際際滷s
Celine George
How to Render Dynamic Data using RPC call in Odoo 17 POS
How to Render Dynamic Data using RPC call in Odoo 17 POSHow to Render Dynamic Data using RPC call in Odoo 17 POS
How to Render Dynamic Data using RPC call in Odoo 17 POS
Celine George
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
How to Create an App Using Odoo 17 Studio
How to Create an App Using Odoo 17 StudioHow to Create an App Using Odoo 17 Studio
How to Create an App Using Odoo 17 Studio
Celine George
How to add button in list view Odoo 17 - Odoo 17 際際滷s
How to add button in list view Odoo 17 - Odoo 17 際際滷sHow to add button in list view Odoo 17 - Odoo 17 際際滷s
How to add button in list view Odoo 17 - Odoo 17 際際滷s
Celine George
Epic net content
Epic net contentEpic net content
Epic net content
Harry Rorarius
Banner ads manager magento extension
Banner ads manager magento extensionBanner ads manager magento extension
Banner ads manager magento extension
NETBASE CMSMART
Bit2win 20r3.0 release pack
Bit2win 20r3.0 release packBit2win 20r3.0 release pack
Bit2win 20r3.0 release pack
Giacinto Mozzetta
2019 ottobre 28 english gdoox personal profile
2019 ottobre 28 english gdoox personal profile2019 ottobre 28 english gdoox personal profile
2019 ottobre 28 english gdoox personal profile
Daniel Rueda H
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
Celine George
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷sHTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
HTML Editor in Odoo 18 - Odoo 18 Technical 際際滷s
Celine George
How to Add Custom Fields to Configuration Settings in Odoo 17
How to Add Custom Fields to Configuration Settings in Odoo 17How to Add Custom Fields to Configuration Settings in Odoo 17
How to Add Custom Fields to Configuration Settings in Odoo 17
Celine George
How to modify_create components control buttons in Pos odoo.pptx
How to modify_create components control buttons in Pos odoo.pptxHow to modify_create components control buttons in Pos odoo.pptx
How to modify_create components control buttons in Pos odoo.pptx
Celine George
HTML Widgets For Search
HTML Widgets For SearchHTML Widgets For Search
HTML Widgets For Search
Jayesh Bhoyar
How to Create & Configure Server Actions in the Odoo 18
How to Create & Configure Server Actions in the Odoo 18How to Create & Configure Server Actions in the Odoo 18
How to Create & Configure Server Actions in the Odoo 18
Celine George
How to hide the buttons on the POS screen in Odoo 17
How to hide the buttons on the POS screen in Odoo 17How to hide the buttons on the POS screen in Odoo 17
How to hide the buttons on the POS screen in Odoo 17
Celine George
How To Create Record From Code In Odoo 17
How To Create Record From Code In Odoo 17How To Create Record From Code In Odoo 17
How To Create Record From Code In Odoo 17
Celine George
Embellish bureau
Embellish bureauEmbellish bureau
Embellish bureau
siraj10
The EffiChange XPager Suite: Understanding XPages Scaffolding
The EffiChange XPager Suite: Understanding XPages ScaffoldingThe EffiChange XPager Suite: Understanding XPages Scaffolding
The EffiChange XPager Suite: Understanding XPages Scaffolding
EffiChange LLC
New Features in Odoo 17 Website Module - Odoo 17 際際滷s
New Features in Odoo 17 Website Module - Odoo 17 際際滷sNew Features in Odoo 17 Website Module - Odoo 17 際際滷s
New Features in Odoo 17 Website Module - Odoo 17 際際滷s
Celine George
How to Render Dynamic Data using RPC call in Odoo 17 POS
How to Render Dynamic Data using RPC call in Odoo 17 POSHow to Render Dynamic Data using RPC call in Odoo 17 POS
How to Render Dynamic Data using RPC call in Odoo 17 POS
Celine George
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
How to Create an App Using Odoo 17 Studio
How to Create an App Using Odoo 17 StudioHow to Create an App Using Odoo 17 Studio
How to Create an App Using Odoo 17 Studio
Celine George
How to add button in list view Odoo 17 - Odoo 17 際際滷s
How to add button in list view Odoo 17 - Odoo 17 際際滷sHow to add button in list view Odoo 17 - Odoo 17 際際滷s
How to add button in list view Odoo 17 - Odoo 17 際際滷s
Celine George
Banner ads manager magento extension
Banner ads manager magento extensionBanner ads manager magento extension
Banner ads manager magento extension
NETBASE CMSMART
Bit2win 20r3.0 release pack
Bit2win 20r3.0 release packBit2win 20r3.0 release pack
Bit2win 20r3.0 release pack
Giacinto Mozzetta
2019 ottobre 28 english gdoox personal profile
2019 ottobre 28 english gdoox personal profile2019 ottobre 28 english gdoox personal profile
2019 ottobre 28 english gdoox personal profile
Daniel Rueda H

More from Celine George (20)

How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 SalesHow to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
Celine George
URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George
How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 SalesHow to Grant Discounts in Sale Order Lines in Odoo 18 Sales
How to Grant Discounts in Sale Order Lines in Odoo 18 Sales
Celine George
URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George

Recently uploaded (20)

Unit No. 4 - Immunopharmacologyslides.pptx
Unit No. 4 - Immunopharmacologyslides.pptxUnit No. 4 - Immunopharmacologyslides.pptx
Unit No. 4 - Immunopharmacologyslides.pptx
Ashish Umale
2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions
leigh441292
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. DabhadeSynthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. DabhadeIntroduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptxA-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
Quiz Club of PSG College of Arts & Science
The Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptxThe Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptx
SamarHosni3
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. DabhadeCombinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...
keshanf79
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-6-2025 ver 5.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-6-2025 ver 5.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-6-2025 ver 5.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-6-2025 ver 5.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
"The Write Path: Navigating Research Writing, Publication, and Professional G...
"The Write Path: Navigating Research Writing, Publication, and Professional G..."The Write Path: Navigating Research Writing, Publication, and Professional G...
"The Write Path: Navigating Research Writing, Publication, and Professional G...
neelottama
UNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptxUNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptx
HARIHARAN A
McElaney "What is inclusive publishing and why do we care about accessibility...
McElaney "What is inclusive publishing and why do we care about accessibility...McElaney "What is inclusive publishing and why do we care about accessibility...
McElaney "What is inclusive publishing and why do we care about accessibility...
National Information Standards Organization (NISO)
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdfIB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
Dr. Mahtab Alam
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptxBIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
maniramkumar
Proteins, Bio similars & Antibodies.pptx
Proteins, Bio similars &  Antibodies.pptxProteins, Bio similars &  Antibodies.pptx
Proteins, Bio similars & Antibodies.pptx
Ashish Umale
MUSIC QUIZ | THE QUIZ CLUB OF PSGCAS | 12 MARCH 2025
MUSIC QUIZ | THE QUIZ CLUB OF PSGCAS | 12 MARCH 2025MUSIC QUIZ | THE QUIZ CLUB OF PSGCAS | 12 MARCH 2025
MUSIC QUIZ | THE QUIZ CLUB OF PSGCAS | 12 MARCH 2025
Quiz Club of PSG College of Arts & Science
Research in Physical Education by Diwakar Kashyap Sir
Research in Physical Education by Diwakar Kashyap SirResearch in Physical Education by Diwakar Kashyap Sir
Research in Physical Education by Diwakar Kashyap Sir
Diwakar Kashyap
SUPPOSITORIES
SUPPOSITORIESSUPPOSITORIES
SUPPOSITORIES
Shantanu Ranjan
APM London Network: Essentials of a Good PMO, 2 April 2025
APM London Network: Essentials of a Good PMO, 2 April 2025APM London Network: Essentials of a Good PMO, 2 April 2025
APM London Network: Essentials of a Good PMO, 2 April 2025
Association for Project Management
Unit No. 4 - Immunopharmacologyslides.pptx
Unit No. 4 - Immunopharmacologyslides.pptxUnit No. 4 - Immunopharmacologyslides.pptx
Unit No. 4 - Immunopharmacologyslides.pptx
Ashish Umale
2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions
leigh441292
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. DabhadeSynthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. DabhadeIntroduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Introduction to Drug Design.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi
The Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptxThe Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptx
SamarHosni3
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. DabhadeCombinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...
keshanf79
"The Write Path: Navigating Research Writing, Publication, and Professional G...
"The Write Path: Navigating Research Writing, Publication, and Professional G..."The Write Path: Navigating Research Writing, Publication, and Professional G...
"The Write Path: Navigating Research Writing, Publication, and Professional G...
neelottama
UNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptxUNIT 1 Introduction to communication.pptx
UNIT 1 Introduction to communication.pptx
HARIHARAN A
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdfIB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
IB-Unit-4 BBA BVIMR 2022 Syllabus_watermark.pdf
Dr. Mahtab Alam
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptxBIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
maniramkumar
Proteins, Bio similars & Antibodies.pptx
Proteins, Bio similars &  Antibodies.pptxProteins, Bio similars &  Antibodies.pptx
Proteins, Bio similars & Antibodies.pptx
Ashish Umale
Research in Physical Education by Diwakar Kashyap Sir
Research in Physical Education by Diwakar Kashyap SirResearch in Physical Education by Diwakar Kashyap Sir
Research in Physical Education by Diwakar Kashyap Sir
Diwakar Kashyap

How to make a field widget in odoo 17 - Odoo 際際滷s

  • 1. How to make a field widget in odoo 17 Enterprise
  • 2. Introduction Enterprise In this slide well 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 odoos 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