SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
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!

Más contenido relacionado

La actualidad más candente

Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in OdooOdoo
 
Defining Kanban View in Odoo15 | Advanced Views
Defining Kanban View in Odoo15 | Advanced ViewsDefining Kanban View in Odoo15 | Advanced Views
Defining Kanban View in Odoo15 | Advanced ViewsCeline George
 
Odoo Code Hardening [Odoo Experience 2019]
Odoo Code Hardening [Odoo Experience 2019]Odoo Code Hardening [Odoo Experience 2019]
Odoo Code Hardening [Odoo Experience 2019]Olivier Dony
 
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
 
Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15Celine George
 
Creating Menu and Actions in Odoo 15
Creating Menu and Actions in Odoo 15Creating Menu and Actions in Odoo 15
Creating Menu and Actions in Odoo 15Celine George
 
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
 
How to show warning _ error messages in Odoo 16
How to show warning _ error messages in Odoo 16 How to show warning _ error messages in Odoo 16
How to show warning _ error messages in Odoo 16 Celine George
 
Actions and menus in odoo 16
Actions and menus in odoo 16Actions and menus in odoo 16
Actions and menus in odoo 16Celine George
 
List Activity Widget in Odoo 14
List Activity Widget in Odoo 14 List Activity Widget in Odoo 14
List Activity Widget in Odoo 14 Celine George
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15Celine George
 
How to Define Many2many Field in Odoo 15
How to Define Many2many Field in Odoo 15How to Define Many2many Field in Odoo 15
How to Define Many2many Field in Odoo 15Celine George
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesOdoo
 
Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo
 
View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15Celine George
 
Odoo External API
Odoo External APIOdoo External API
Odoo External APIOdoo
 
Learn How to Manage Storage Locations Odoo 15
Learn How to Manage Storage Locations Odoo 15Learn How to Manage Storage Locations Odoo 15
Learn How to Manage Storage Locations Odoo 15Celine George
 
Empower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsEmpower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsOdoo
 
How to Import data into OpenERP V7
How to Import data into OpenERP V7How to Import data into OpenERP V7
How to Import data into OpenERP V7Audaxis
 
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
 

La actualidad más candente (20)

Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in Odoo
 
Defining Kanban View in Odoo15 | Advanced Views
Defining Kanban View in Odoo15 | Advanced ViewsDefining Kanban View in Odoo15 | Advanced Views
Defining Kanban View in Odoo15 | Advanced Views
 
Odoo Code Hardening [Odoo Experience 2019]
Odoo Code Hardening [Odoo Experience 2019]Odoo Code Hardening [Odoo Experience 2019]
Odoo Code Hardening [Odoo Experience 2019]
 
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
 
Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15Set Default Values to Fields in Odoo 15
Set Default Values to Fields in Odoo 15
 
Creating Menu and Actions in Odoo 15
Creating Menu and Actions in Odoo 15Creating Menu and Actions in Odoo 15
Creating Menu and Actions in Odoo 15
 
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
 
How to show warning _ error messages in Odoo 16
How to show warning _ error messages in Odoo 16 How to show warning _ error messages in Odoo 16
How to show warning _ error messages in Odoo 16
 
Actions and menus in odoo 16
Actions and menus in odoo 16Actions and menus in odoo 16
Actions and menus in odoo 16
 
List Activity Widget in Odoo 14
List Activity Widget in Odoo 14 List Activity Widget in Odoo 14
List Activity Widget in Odoo 14
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15
 
How to Define Many2many Field in Odoo 15
How to Define Many2many Field in Odoo 15How to Define Many2many Field in Odoo 15
How to Define Many2many Field in Odoo 15
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your Modules
 
Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo - Backend modules in v8
Odoo - Backend modules in v8
 
View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
 
Odoo External API
Odoo External APIOdoo External API
Odoo External API
 
Learn How to Manage Storage Locations Odoo 15
Learn How to Manage Storage Locations Odoo 15Learn How to Manage Storage Locations Odoo 15
Learn How to Manage Storage Locations Odoo 15
 
Empower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsEmpower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo Mixins
 
How to Import data into OpenERP V7
How to Import data into OpenERP V7How to Import data into OpenERP V7
How to Import data into OpenERP V7
 
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
 

Similar a 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 a 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
 

Más de 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
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & StrategyOdoo
 
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
 

Más de 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!
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & Strategy
 
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
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 

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)