際際滷

際際滷Share a Scribd company logo
How To Add Smart
Buttons In Odoo17
Enterprise
Introduction
Enterprise
Smart buttons in Odoo provide quick access to related records
and actions, enhancing the user experience by making
navigation and operations more intuitive and efficient
Enterprise
Step 1 :
 Inherit the desired view and insert button in the smart
button area.
<odoo>
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.form.inherit.my.blog</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button"
type="object"
icon="fa-taxi"
name="action_get_vehicles_record">
<field string="Vehicles" name="vehicle_count"
widget="statinfo"/>
</button>
</div>
</field>
</record>
</odoo>
Enterprise
Step 2:
 Add python, inherit the desired model and add function
on the name of the button
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
def action_get_vehicles_record(self):
self.ensure_one()
return {
'type': 'ir.actions.act_window',
'name': 'Vehicles',
'view_mode': 'tree,form',
'res_model': 'fleet.vehicle',
'domain': [('driver_id', '=', self.id)],
'context': "{'create': False}"
}
Enterprise
Step 3
Open the corresponding view where we have added the smart
button, we can see the smart button has been added.
Enterprise
Step 4:
 If we want to see the number of record, We can add an
integer fields and its compute function as in the below
code
vehicle_count = fields.Integer(string="Vehicles",
compute='compute_vehicle_count',
default=0)
def compute_vehicle_count(self):
for record in self:
record.vehicle_count = self.env[
'fleet.vehicle'].search_count(
[('driver_id', '=', self.id)])
Enterprise
Step 5:
Open the view and we can see the count has been added
with the smart button.
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 Add Smart Buttons In Odoo 17 - Odoo 際際滷s (20)

Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Celine George
How to perform product search based on a custom field from the PoS screen of ...
How to perform product search based on a custom field from the PoS screen of ...How to perform product search based on a custom field from the PoS screen of ...
How to perform product search based on a custom field from the PoS screen of ...
Celine George
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷sHow to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷sHow to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷sHow to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
Celine George
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
Nico Miceli
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
Report Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷sReport Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
How to Create a Custom Web Form View in Odoo 17
How to Create a Custom  Web Form View in Odoo 17How to Create a Custom  Web Form View in Odoo 17
How to Create a Custom Web Form View in Odoo 17
Celine George
How To Extend Odoo Form View using js_class_
How To Extend Odoo Form View using js_class_How To Extend Odoo Form View using js_class_
How To Extend Odoo Form View using js_class_
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
How to Manage the Attendance of Employees in Odoo 17 Attendance
How to Manage the Attendance of Employees in Odoo 17 AttendanceHow to Manage the Attendance of Employees in Odoo 17 Attendance
How to Manage the Attendance of Employees in Odoo 17 Attendance
Celine George
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
Odoo 12 - Mobile Service Management Pro
Odoo 12 - Mobile Service Management ProOdoo 12 - Mobile Service Management Pro
Odoo 12 - Mobile Service Management Pro
Celine George
odoo website helpdesk Ticket management app
odoo website helpdesk Ticket management appodoo website helpdesk Ticket management app
odoo website helpdesk Ticket management app
Aagam infotech
How to add menu in Odoo 17 Website - Odoo 17 際際滷s
How to add menu in Odoo 17 Website - Odoo 17 際際滷sHow to add menu in Odoo 17 Website - Odoo 17 際際滷s
How to add menu in Odoo 17 Website - Odoo 17 際際滷s
Celine George
Mobile management
Mobile managementMobile management
Mobile management
Freelancer
How to Create Ticket From Odoo 17 Website Form
How to Create Ticket From Odoo 17 Website FormHow to Create Ticket From Odoo 17 Website Form
How to Create Ticket From Odoo 17 Website Form
Celine George
Point of Sale.pptx
Point of Sale.pptxPoint of Sale.pptx
Point of Sale.pptx
YagnikPoshiya
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17Views in Odoo - Advanced Views - Pivot View in Odoo 17
Views in Odoo - Advanced Views - Pivot View in Odoo 17
Celine George
How to perform product search based on a custom field from the PoS screen of ...
How to perform product search based on a custom field from the PoS screen of ...How to perform product search based on a custom field from the PoS screen of ...
How to perform product search based on a custom field from the PoS screen of ...
Celine George
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷sHow to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷sHow to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
How to Add Button in Chatter in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷sHow to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s
Celine George
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
Nico Miceli
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
Report Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷sReport Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
How to Create a Custom Web Form View in Odoo 17
How to Create a Custom  Web Form View in Odoo 17How to Create a Custom  Web Form View in Odoo 17
How to Create a Custom Web Form View in Odoo 17
Celine George
How To Extend Odoo Form View using js_class_
How To Extend Odoo Form View using js_class_How To Extend Odoo Form View using js_class_
How To Extend Odoo Form View using js_class_
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
How to Manage the Attendance of Employees in Odoo 17 Attendance
How to Manage the Attendance of Employees in Odoo 17 AttendanceHow to Manage the Attendance of Employees in Odoo 17 Attendance
How to Manage the Attendance of Employees in Odoo 17 Attendance
Celine George
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
Odoo 12 - Mobile Service Management Pro
Odoo 12 - Mobile Service Management ProOdoo 12 - Mobile Service Management Pro
Odoo 12 - Mobile Service Management Pro
Celine George
odoo website helpdesk Ticket management app
odoo website helpdesk Ticket management appodoo website helpdesk Ticket management app
odoo website helpdesk Ticket management app
Aagam infotech
How to add menu in Odoo 17 Website - Odoo 17 際際滷s
How to add menu in Odoo 17 Website - Odoo 17 際際滷sHow to add menu in Odoo 17 Website - Odoo 17 際際滷s
How to add menu in Odoo 17 Website - Odoo 17 際際滷s
Celine George
Mobile management
Mobile managementMobile management
Mobile management
Freelancer
How to Create Ticket From Odoo 17 Website Form
How to Create Ticket From Odoo 17 Website FormHow to Create Ticket From Odoo 17 Website Form
How to Create Ticket From Odoo 17 Website Form
Celine George
Point of Sale.pptx
Point of Sale.pptxPoint of Sale.pptx
Point of Sale.pptx
YagnikPoshiya

More from Celine George (20)

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
Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17
Celine George
List View Attributes in Odoo 18 - Odoo 際際滷s
List View Attributes in Odoo 18 - Odoo 際際滷sList View Attributes in Odoo 18 - Odoo 際際滷s
List View Attributes in Odoo 18 - Odoo 際際滷s
Celine George
How to Set Default Terms and Conditions in Odoo 17 Accounting
How to Set Default Terms and Conditions in Odoo 17 AccountingHow to Set Default Terms and Conditions in Odoo 17 Accounting
How to Set Default Terms and Conditions in Odoo 17 Accounting
Celine George
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo SalesEnhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
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
Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17Comparing RFQ Lines for the best price in Odoo 17
Comparing RFQ Lines for the best price in Odoo 17
Celine George
List View Attributes in Odoo 18 - Odoo 際際滷s
List View Attributes in Odoo 18 - Odoo 際際滷sList View Attributes in Odoo 18 - Odoo 際際滷s
List View Attributes in Odoo 18 - Odoo 際際滷s
Celine George
How to Set Default Terms and Conditions in Odoo 17 Accounting
How to Set Default Terms and Conditions in Odoo 17 AccountingHow to Set Default Terms and Conditions in Odoo 17 Accounting
How to Set Default Terms and Conditions in Odoo 17 Accounting
Celine George
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo SalesEnhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
Enhance Your Quotations by Sections, Notes, and Subtotals in Odoo Sales
Celine George

Recently uploaded (20)

Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
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
Unit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition EnginesUnit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition Engines
NileshKumbhar21
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptxANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
PRADEEP ABOTHU
ANTIVIRAL agent by Mrs. Manjushri Dabhade
ANTIVIRAL agent by Mrs. Manjushri DabhadeANTIVIRAL agent by Mrs. Manjushri Dabhade
ANTIVIRAL agent by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Gold Spot Dairy Store Jordan Minnesota 55352
Gold Spot Dairy Store Jordan Minnesota 55352Gold Spot Dairy Store Jordan Minnesota 55352
Gold Spot Dairy Store Jordan Minnesota 55352
Forklift Trucks in Minnesota
Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
 Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ... Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
coreylewis960
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 basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
heathfieldcps1
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)
Studying and Notetaking: Some Suggestions
Studying and Notetaking: Some SuggestionsStudying and Notetaking: Some Suggestions
Studying and Notetaking: Some Suggestions
Damian T. Gordon
Sulfonamides by Mrs. Manjushri P. Dabhade
Sulfonamides by Mrs. Manjushri P. DabhadeSulfonamides by Mrs. Manjushri P. Dabhade
Sulfonamides by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Design approaches and ethical challenges in Artificial Intelligence tools for...
Design approaches and ethical challenges in Artificial Intelligence tools for...Design approaches and ethical challenges in Artificial Intelligence tools for...
Design approaches and ethical challenges in Artificial Intelligence tools for...
Yannis
Unit No 4- Chemotherapy of Malignancy.pptx
Unit No  4- Chemotherapy of Malignancy.pptxUnit No  4- Chemotherapy of Malignancy.pptx
Unit No 4- Chemotherapy of Malignancy.pptx
Ashish Umale
Chapter 6. Business and Corporate Strategy Formulation.pdf
Chapter 6. Business and Corporate Strategy Formulation.pdfChapter 6. Business and Corporate Strategy Formulation.pdf
Chapter 6. Business and Corporate Strategy Formulation.pdf
Rommel Regala
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
Amlan Sarkar
MIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert KlinskiMIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert Klinski
MIPLM
Knownsense 2025 prelims- U-25 General Quiz.pdf
Knownsense 2025 prelims- U-25 General Quiz.pdfKnownsense 2025 prelims- U-25 General Quiz.pdf
Knownsense 2025 prelims- U-25 General Quiz.pdf
Pragya - UEM Kolkata Quiz Club
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
Prabhakar Singh Patel
MIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha KamhuberMIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha Kamhuber
MIPLM
Different perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdfDifferent perspectives on dugout canoe heritage of Soomaa.pdf
Different perspectives on dugout canoe heritage of Soomaa.pdf
Aivar Ruukel
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
Unit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition EnginesUnit 3: Combustion in Spark Ignition Engines
Unit 3: Combustion in Spark Ignition Engines
NileshKumbhar21
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptxANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT PPT.pptx
PRADEEP ABOTHU
ANTIVIRAL agent by Mrs. Manjushri Dabhade
ANTIVIRAL agent by Mrs. Manjushri DabhadeANTIVIRAL agent by Mrs. Manjushri Dabhade
ANTIVIRAL agent by Mrs. Manjushri Dabhade
Dabhade madam Dabhade
Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
 Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ... Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
Marketing is Everything in the Beauty Business! 憓 Talent gets you in the ...
coreylewis960
The basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptxThe basics of sentences session 9pptx.pptx
The basics of sentences session 9pptx.pptx
heathfieldcps1
Studying and Notetaking: Some Suggestions
Studying and Notetaking: Some SuggestionsStudying and Notetaking: Some Suggestions
Studying and Notetaking: Some Suggestions
Damian T. Gordon
Sulfonamides by Mrs. Manjushri P. Dabhade
Sulfonamides by Mrs. Manjushri P. DabhadeSulfonamides by Mrs. Manjushri P. Dabhade
Sulfonamides by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
Design approaches and ethical challenges in Artificial Intelligence tools for...
Design approaches and ethical challenges in Artificial Intelligence tools for...Design approaches and ethical challenges in Artificial Intelligence tools for...
Design approaches and ethical challenges in Artificial Intelligence tools for...
Yannis
Unit No 4- Chemotherapy of Malignancy.pptx
Unit No  4- Chemotherapy of Malignancy.pptxUnit No  4- Chemotherapy of Malignancy.pptx
Unit No 4- Chemotherapy of Malignancy.pptx
Ashish Umale
Chapter 6. Business and Corporate Strategy Formulation.pdf
Chapter 6. Business and Corporate Strategy Formulation.pdfChapter 6. Business and Corporate Strategy Formulation.pdf
Chapter 6. Business and Corporate Strategy Formulation.pdf
Rommel Regala
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
General Quiz at ChakraView 2025 | Amlan Sarkar | Ashoka Univeristy | Prelims ...
Amlan Sarkar
MIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert KlinskiMIPLM subject matter expert Dr Robert Klinski
MIPLM subject matter expert Dr Robert Klinski
MIPLM
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
URINE SPECIMEN COLLECTION AND HANDLING CLASS 1 FOR ALL PARAMEDICAL OR CLINICA...
Prabhakar Singh Patel
MIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha KamhuberMIPLM subject matter expert Sascha Kamhuber
MIPLM subject matter expert Sascha Kamhuber
MIPLM

How To Add Smart Buttons In Odoo 17 - Odoo 際際滷s

  • 1. How To Add Smart Buttons In Odoo17 Enterprise
  • 2. Introduction Enterprise Smart buttons in Odoo provide quick access to related records and actions, enhancing the user experience by making navigation and operations more intuitive and efficient
  • 3. Enterprise Step 1 : Inherit the desired view and insert button in the smart button area. <odoo> <record id="view_partner_form" model="ir.ui.view"> <field name="name">res.partner.form.inherit.my.blog</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <div name="button_box" position="inside"> <button class="oe_stat_button" type="object" icon="fa-taxi" name="action_get_vehicles_record"> <field string="Vehicles" name="vehicle_count" widget="statinfo"/> </button> </div> </field> </record> </odoo>
  • 4. Enterprise Step 2: Add python, inherit the desired model and add function on the name of the button from odoo import fields, models class ResPartner(models.Model): _inherit = "res.partner" def action_get_vehicles_record(self): self.ensure_one() return { 'type': 'ir.actions.act_window', 'name': 'Vehicles', 'view_mode': 'tree,form', 'res_model': 'fleet.vehicle', 'domain': [('driver_id', '=', self.id)], 'context': "{'create': False}" }
  • 5. Enterprise Step 3 Open the corresponding view where we have added the smart button, we can see the smart button has been added.
  • 6. Enterprise Step 4: If we want to see the number of record, We can add an integer fields and its compute function as in the below code vehicle_count = fields.Integer(string="Vehicles", compute='compute_vehicle_count', default=0) def compute_vehicle_count(self): for record in self: record.vehicle_count = self.env[ 'fleet.vehicle'].search_count( [('driver_id', '=', self.id)])
  • 7. Enterprise Step 5: Open the view and we can see the count has been added with the smart button.
  • 8. 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

Editor's Notes

  • #5: Add clear screen shot