SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
Odoo
 

Was ist angesagt? (20)

QWeb Report in odoo
QWeb Report in odooQWeb Report in odoo
QWeb Report in odoo
 
How to Design Resilient Odoo Crons
How to Design Resilient Odoo CronsHow to Design Resilient Odoo Crons
How to Design Resilient Odoo Crons
 
The Odoo JS Framework
The Odoo JS FrameworkThe Odoo JS Framework
The Odoo JS Framework
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
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
 
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
 
Odoo - Create themes for website
Odoo - Create themes for websiteOdoo - Create themes for website
Odoo - Create themes for website
 
Tools for Solving Performance Issues
Tools for Solving Performance IssuesTools for Solving Performance Issues
Tools for Solving Performance Issues
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)odoo 11.0 development (CRUD)
odoo 11.0 development (CRUD)
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 
Building l10n Payroll Structures from the Ground up
Building l10n Payroll Structures from the Ground upBuilding l10n Payroll Structures from the Ground up
Building l10n Payroll Structures from the Ground up
 
New Framework - ORM
New Framework - ORMNew Framework - ORM
New Framework - ORM
 
Best Tools for first time Odoo Development
Best Tools for first time Odoo DevelopmentBest Tools for first time Odoo Development
Best Tools for first time Odoo Development
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo apps
 
Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo - Backend modules in v8
Odoo - Backend modules in v8
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
 
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
 
Odoo Warehouse Management
Odoo Warehouse ManagementOdoo Warehouse Management
Odoo Warehouse Management
 
Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in Odoo
 

Ähnlich wie Odoo - Smart buttons

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
Muhd Basheer
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design Information
Christopher Orchard
 

Ähnlich wie 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
 

Mehr von Odoo

Mehr von 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
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

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)