Home >Technology >Odoo - Smart buttons

Odoo - Smart buttons

Date post:09-May-2015
Category:
View:7,672 times
Download:0 times
Share this document with a friend
Description:
1. What are Smart Buttons? 2. From Regular Buttons to Smart Buttons 3. Magic! (not really) 4. Customizing the Look 5. Customizing the Content
Transcript:
  • 1.Smart Buttons in v8 Gry 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? 4. Smart Buttons 5. Smart Buttons (2) FromFrom ToTo 6. Smart Buttons (3) Two biggest advantages: dynamic, customizable. 7. From Regular to Smart it's not hard 8. Converting a plain button Before: /> After: /> 9. Converting a plain button (2) Just add 'icon' attribute. /> 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: Now, it can contain literally anything: literally anything The form view parse the button and render anything inside (html/Odoo widgets) 12. Example (html) Pure html : Full control on the content >

Hello Odoo

Result: 13. Example (html+eld) > /> Opportunities Result: This is fully dynamic! 14. Common situation: One2many elds Example: phonecall_ids in res.partner. Step 1: add functional eld phonecall_count to res.partner Step 2: add eld with widget 'statinfo' > /> 15. Customize your buttons We can customize in two ways: 16. Customizing Content 17. Case study: Sum of all invoices for a customer 1. add functional eld '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 eld to button > /> 3. prot! 19. Customizing Look 20. PercentPie Widget Percentage (integer between 0 and 100) > /> 21. Bar Chart Widget Need to display some kind of trends? Use BarChart Widget! > /> (see mass_mailing.py for full details) 22. Thank you!

Click here to load reader

Embed Size (px)
Recommended