SlideShare a Scribd company logo
1 of 22
Download to read offline
Smart Buttons in v8
Géry Debongnie
Content
1. What are Smart Buttons?
2. From Regular Buttons to Smart Buttons
3. Magic! (not really)
4. Customizing the Look
5. Customizing the Content
What are Smart Buttons?
Smart Buttons
Smart Buttons (2)
FromFrom
ToTo
Smart Buttons (3)
Two biggest advantages:
dynamic,
customizable.
·
·
From Regular to Smart
it's not hard
Converting a plain button
Before:
<button<button class="oe_inline" type="action"
string="Opportunities"
name="..." context="..."/>/>
After:
<button<button class="oe_inline oe_stat_button" type="action"
string="Opportunities"
name="..." context="..."/>/>
Converting a plain button (2)
Just add 'icon' attribute.
<button<button class="oe_inline oe_stat_button" type="action"
string="Opportunities"
icon="fa-star"
name="..." context="..."/>/>
Font awesome:
http://fortawesome.github.io/Font-Awesome/
Where is the magic?
(next slide)
Button tag can contain
anything
Before, the button tag was self-closed:
<button/><button/>
Now, it can contain literally anything:
<button><button>
literally anything
</button></button>
The form view parse the button and render anything inside
(html/Odoo widgets)
Example (html)
Pure html : Full control on the content
<button<button class="..." type="..." name="..." context="...">>
<p><p>Hello <strong><strong>Odoo</strong></p></strong></p>
</button></button>
Result:
Example (html+field)
<button<button class="..." type="..." name="..." icon="fa-star">>
<span><field<span><field name="opportunity_count"/>/> Opportunities</span></span>
</button></button>
Result:
This is fully dynamic!
Common situation:
One2many fields
Example: phonecall_ids in res.partner.
Step 1: add functional field phonecall_count to res.partner
Step 2: add field with widget 'statinfo'
<button<button class="..." type="..." name="..." icon="..." context="...">>
<field<field string="Calls" name="phonecall_count" widget="statinfo"/>/>
</button></button>
Customize your buttons
We can customize in two ways:
Customizing Content
Case study: Sum of all
invoices for a customer
1. add functional field
'total_invoiced':: fields..function((_invoice_total,,
string=="Total Invoiced",,
type=='float'))
defdef _invoice_total((self,, cr,, uid,, ids,, field_name,, arg,, context==None):):
result == {}{}
account_invoice_report == self..pool..get(('account.invoice.report'))
forfor partner inin self..browse((cr,, uid,, ids,, context==context):):
......
returnreturn result
Case study: Sum of all
invoices for a customer (2)
2. add field to button
<button<button type="action" class="oe_stat_button"
icon="fa-pencil-square-o" name="..." context="..." >>
<field<field name="total_invoiced" widget="statinfo"/>/>
</button></button>
3. profit!
Customizing Look
PercentPie Widget
Percentage (integer between 0 and 100)
<button<button name="..." type="action" class="oe_stat_button">>
<field<field name="received_ratio"
string="Received"
widget="percentpie"/>/>
</button></button>
Bar Chart Widget
Need to display some kind of trends? Use BarChart Widget!
<button<button name="..." type="action" class="oe_stat_button">>
<field<field name="opened_daily"
string="Opened Daily"
widget="barchart"/>/>
</button></button>
(see mass_mailing.py for full details)
Thank you!

More Related Content

What's hot

View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16Celine George
 
Replacing a Field in Tree View Odoo 15
Replacing a Field in Tree View Odoo 15Replacing a Field in Tree View Odoo 15
Replacing a Field in Tree View Odoo 15Celine George
 
Tutorial: Develop an App with the Odoo Framework
Tutorial: Develop an App with the Odoo FrameworkTutorial: Develop an App with the Odoo Framework
Tutorial: Develop an App with the Odoo FrameworkOdoo
 
Create Data Files and Load Data in Odoo 15
Create Data Files and Load Data in Odoo 15Create Data Files and Load Data in Odoo 15
Create Data Files and Load Data in Odoo 15Celine George
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code HardeningOdoo
 
An in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMAn in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMOdoo
 
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Celine George
 
What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15Celine George
 
Odoo's Test Framework - Learn Best Practices
Odoo's Test Framework - Learn Best PracticesOdoo's Test Framework - Learn Best Practices
Odoo's Test Framework - Learn Best PracticesOdoo
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & StrategyOdoo
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 formsEyal Vardi
 
Odoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkOdoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkElínAnna Jónasdóttir
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design PatternsMax Pronko
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data BindingDuy Khanh
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlOdoo
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in ScalaHermann Hueck
 
External dependencies ,pre init hook &amp; post init hook in odoo
External dependencies ,pre init hook &amp; post init hook in odooExternal dependencies ,pre init hook &amp; post init hook in odoo
External dependencies ,pre init hook &amp; post init hook in odooCeline George
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo
 

What's hot (20)

View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16
 
Replacing a Field in Tree View Odoo 15
Replacing a Field in Tree View Odoo 15Replacing a Field in Tree View Odoo 15
Replacing a Field in Tree View Odoo 15
 
Tutorial: Develop an App with the Odoo Framework
Tutorial: Develop an App with the Odoo FrameworkTutorial: Develop an App with the Odoo Framework
Tutorial: Develop an App with the Odoo Framework
 
Create Data Files and Load Data in Odoo 15
Create Data Files and Load Data in Odoo 15Create Data Files and Load Data in Odoo 15
Create Data Files and Load Data in Odoo 15
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
An in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMAn in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORM
 
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15
 
What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15What is Delegation Inheritance in Odoo 15
What is Delegation Inheritance in Odoo 15
 
Odoo's Test Framework - Learn Best Practices
Odoo's Test Framework - Learn Best PracticesOdoo's Test Framework - Learn Best Practices
Odoo's Test Framework - Learn Best Practices
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & Strategy
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 
Odoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS FrameworkOdoo Experience 2018 - The Odoo JS Framework
Odoo Experience 2018 - The Odoo JS Framework
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in Owl
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
External dependencies ,pre init hook &amp; post init hook in odoo
External dependencies ,pre init hook &amp; post init hook in odooExternal dependencies ,pre init hook &amp; post init hook in odoo
External dependencies ,pre init hook &amp; post init hook in odoo
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building Blocks
 

Similar to Odoo - Smart buttons

CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsRonDosh
 
Run and jump tutorial (part 3) behaviours
Run and jump tutorial (part 3)   behavioursRun and jump tutorial (part 3)   behaviours
Run and jump tutorial (part 3) behavioursMuhd Basheer
 
Button Design: A Comprehensive Guide
Button Design: A Comprehensive GuideButton Design: A Comprehensive Guide
Button Design: A Comprehensive Guide300Mind
 
Sketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingSketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingStefan Baumgartner
 
Day to day use of Logical Triggers.pdf
Day to day use of Logical Triggers.pdfDay to day use of Logical Triggers.pdf
Day to day use of Logical Triggers.pdfHasseyWijetunge
 
Creating a button shortcode
Creating a button shortcodeCreating a button shortcode
Creating a button shortcodeLauren Pittenger
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design InformationChristopher Orchard
 
QRG - How to show hidden content using a button.pdf
QRG - How to show hidden content using a button.pdfQRG - How to show hidden content using a button.pdf
QRG - How to show hidden content using a button.pdfHasseyWijetunge
 

Similar to Odoo - Smart buttons (12)

CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
 
Run and jump tutorial (part 3) behaviours
Run and jump tutorial (part 3)   behavioursRun and jump tutorial (part 3)   behaviours
Run and jump tutorial (part 3) behaviours
 
Module based
Module basedModule based
Module based
 
Button Design: A Comprehensive Guide
Button Design: A Comprehensive GuideButton Design: A Comprehensive Guide
Button Design: A Comprehensive Guide
 
Web Button OTP Widget
Web Button OTP Widget Web Button OTP Widget
Web Button OTP Widget
 
Sketchmine: Design Systems Tooling
Sketchmine: Design Systems ToolingSketchmine: Design Systems Tooling
Sketchmine: Design Systems Tooling
 
Day to day use of Logical Triggers.pdf
Day to day use of Logical Triggers.pdfDay to day use of Logical Triggers.pdf
Day to day use of Logical Triggers.pdf
 
Creating a button shortcode
Creating a button shortcodeCreating a button shortcode
Creating a button shortcode
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design Information
 
Microsoft Windows 7 Fundamentals (8th Ed.)
Microsoft Windows 7 Fundamentals (8th Ed.)Microsoft Windows 7 Fundamentals (8th Ed.)
Microsoft Windows 7 Fundamentals (8th Ed.)
 
Lab 6
Lab 6Lab 6
Lab 6
 
QRG - How to show hidden content using a button.pdf
QRG - How to show hidden content using a button.pdfQRG - How to show hidden content using a button.pdf
QRG - How to show hidden content using a button.pdf
 

More from Odoo

Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Odoo
 
Odoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo
 
Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Odoo
 
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityExtending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityOdoo
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooOdoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseOdoo
 
Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Odoo
 
Rock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsRock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsOdoo
 
Transition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationTransition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationOdoo
 
Synchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisSynchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisOdoo
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with OdooOdoo
 
Down Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooDown Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooOdoo
 
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to OdooOdoo
 
Preventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningPreventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningOdoo
 
Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Odoo
 
Instant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelInstant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelOdoo
 
How Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldHow Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldOdoo
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to OdooOdoo
 
Digital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal StoryDigital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal StoryOdoo
 

More from Odoo (20)

Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!
 
Odoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-Viewer
 
Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14
 
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityExtending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with Odoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use Case
 
Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?
 
Rock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsRock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced Operations
 
Transition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationTransition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organization
 
Synchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisSynchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the Crisis
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with Odoo
 
Down Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooDown Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in Odoo
 
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to Odoo
 
Preventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningPreventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine Learning
 
Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification
 
Instant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelInstant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping Label
 
How Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldHow Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 Fold
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to Odoo
 
Digital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal StoryDigital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal Story
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Odoo - Smart buttons

  • 1. Smart Buttons in v8 Géry Debongnie
  • 2. Content 1. What are Smart Buttons? 2. From Regular Buttons to Smart Buttons 3. Magic! (not really) 4. Customizing the Look 5. Customizing the Content
  • 3. What are Smart Buttons?
  • 6. Smart Buttons (3) Two biggest advantages: dynamic, customizable. · ·
  • 7. From Regular to Smart it's not hard
  • 8. Converting a plain button Before: <button<button class="oe_inline" type="action" string="Opportunities" name="..." context="..."/>/> After: <button<button class="oe_inline oe_stat_button" type="action" string="Opportunities" name="..." context="..."/>/>
  • 9. Converting a plain button (2) Just add 'icon' attribute. <button<button class="oe_inline oe_stat_button" type="action" string="Opportunities" icon="fa-star" name="..." context="..."/>/> Font awesome: http://fortawesome.github.io/Font-Awesome/
  • 10. Where is the magic? (next slide)
  • 11. Button tag can contain anything Before, the button tag was self-closed: <button/><button/> Now, it can contain literally anything: <button><button> literally anything </button></button> The form view parse the button and render anything inside (html/Odoo widgets)
  • 12. Example (html) Pure html : Full control on the content <button<button class="..." type="..." name="..." context="...">> <p><p>Hello <strong><strong>Odoo</strong></p></strong></p> </button></button> Result:
  • 13. Example (html+field) <button<button class="..." type="..." name="..." icon="fa-star">> <span><field<span><field name="opportunity_count"/>/> Opportunities</span></span> </button></button> Result: This is fully dynamic!
  • 14. Common situation: One2many fields Example: phonecall_ids in res.partner. Step 1: add functional field phonecall_count to res.partner Step 2: add field with widget 'statinfo' <button<button class="..." type="..." name="..." icon="..." context="...">> <field<field string="Calls" name="phonecall_count" widget="statinfo"/>/> </button></button>
  • 15. Customize your buttons We can customize in two ways:
  • 17. Case study: Sum of all invoices for a customer 1. add functional field 'total_invoiced':: fields..function((_invoice_total,, string=="Total Invoiced",, type=='float')) defdef _invoice_total((self,, cr,, uid,, ids,, field_name,, arg,, context==None):): result == {}{} account_invoice_report == self..pool..get(('account.invoice.report')) forfor partner inin self..browse((cr,, uid,, ids,, context==context):): ...... returnreturn result
  • 18. Case study: Sum of all invoices for a customer (2) 2. add field to button <button<button type="action" class="oe_stat_button" icon="fa-pencil-square-o" name="..." context="..." >> <field<field name="total_invoiced" widget="statinfo"/>/> </button></button> 3. profit!
  • 20. PercentPie Widget Percentage (integer between 0 and 100) <button<button name="..." type="action" class="oe_stat_button">> <field<field name="received_ratio" string="Received" widget="percentpie"/>/> </button></button>
  • 21. Bar Chart Widget Need to display some kind of trends? Use BarChart Widget! <button<button name="..." type="action" class="oe_stat_button">> <field<field name="opened_daily" string="Opened Daily" widget="barchart"/>/> </button></button> (see mass_mailing.py for full details)