SlideShare a Scribd company logo
CMS Dynamic Widgets
Thibault Delavallée, R&D Engineer
Dynamic widgets
ThibaultDelavallée(tde@odoo.com)
Dynamic widgets
Widgets, Snippets -> CMS building blocks
Dynamic widgets: Discussion Groups, Mailing Lists
ThibaultDelavallée(tde@odoo.com)
Dynamic widgets
Efficient and simple way to customize your website
Integrates with Odoo apps: subscribe to a discussion
group, create leads, fill issues, ...
Use the full power of odoo
·
·
·
ThibaultDelavallée(tde@odoo.com)
Show me the stuff !
Running example: Contact WidgetContact Widget
small contact form
create leads from questions
drag 'n drop it anywhere usefull
·
·
·
ThibaultDelavallée(tde@odoo.com)
Demo
Talk structure
Running example: Contact Widget
body, content
addition in CMS editor
dynamic configuration: choosing
the sales team
link with backend: linking the
button to the lead creation
·
·
·
·
ThibaultDelavallée(tde@odoo.com)
Body: widget content
Body = HTMLHTML + CSSCSS (bootstrap)
a (hidden) sales team
a question
an email
a submit button
<input<input type="hidden" name="section_id" value="0"/>/>
<textarea<textarea name="description"></textarea>></textarea>
<div<div class="input-group">>
<input<input type="email" name="email_from"/>/>
<button<button type="submit">>Contact Us</button></button>
</div></div>
·
·
·
·
ThibaultDelavallée(tde@odoo.com)
Addition in Editor
Snippets ? QWeb template !
<?xml version="1.0" encoding="utf-8"?>
<openerp><openerp>
<data><data>
<template<template id="snippets">>
<!-- here be snippets by categories -->
...
</template></template>
</data></data>
</openerp></openerp>
ThibaultDelavallée(tde@odoo.com)
Addition in Editor
Snippet addition: extend the editor QWeb template
<template<template id="contact_snippet"
name="Contact Snippet"
inherit_id="website.snippets">>
<xpath<xpath expr="//div[@id='snippet_feature']" position="inside">>
<!-- begin snippet declaration -->
<div><div>
...
</div></div>
<!-- end of snippet declaration -->
</xpath></xpath>
</template></template>
ThibaultDelavallée(tde@odoo.com)
Addition in Editor
thumbnail: icon in editor
<xpath<xpath expr="//div[@id='snippet_feature']" position="inside">>
...
<div<div class="oe_snippet_thumbnail">>
<img<img class="oe_snippet_thumbnail_img" src="/images/icon.png"/>/>
<span<span class="oe_snippet_thumbnail_title">>Contact Snippet</span></span>
</div></div>
</xpath></xpath>
body of the snippet
<xpath<xpath expr="//div[@id='snippet_feature']" position="inside">>
...
<section<section class="oe_snippet_body js_contact">>
<!-- snippet HTML content -->
</section></section>
</xpath></xpath>
·
·
ThibaultDelavallée(tde@odoo.com)
Snippet options
placement: data-selector-...
menu option: li, option menu entry
<div<div data-snippet-option-id='contact_snippet'
data-selector=".js_contact"
data-selector-siblings="p, h1, h2, h3, blockquote,
div, .well, .panel">>
<li><li>
<a<a href="#" class="button js_contact_sales_team">>
Change Sales Team
</a></a>
</li></li>
</div></div>
·
·
ThibaultDelavallée(tde@odoo.com)
Widget -> Dynamic Widget
Dynamic customize
Customize menu
To link with
ThibaultDelavallée(tde@odoo.com)
Dynamic customize
Add a snippet.Option to add dynamic configuration
Example: Discussion Group choice, Sales Team choice, ...
snippet..options..contact_snippet == snippet..Option..extend({({
on_prompt:: functionfunction ()() {{
returnreturn website..prompt({({
window_title:: _t(("Add a Contact Snippet"),),
init:: functionfunction ((field)) {{
returnreturn website..session..model(('crm.case.section'))
..call(('name_search',, [['',, []])},[]])},
}).}).then((functionfunction ((sales_team_id)) {{
self..$(('.js_section_id').).attr(("value",, sales_team_id););
});});
}}
});});
ThibaultDelavallée(tde@odoo.com)
Link with back-end
To contact the back-end: define a new routeroute
Route: URL -> action performed by server
Defined in Python, in a controller
classclass ContactUsShort((http..Controller):):
# define my custom controller
@http.route@http.route(('/my/route',, ......))
defdef my_route((......):):
{http://myodoo.com/}crm/contact_short will be a route
creating a lead from data coming from the form
·
·
ThibaultDelavallée(tde@odoo.com)
Link with back-end
crm/contact_short definition
@http.route@http.route([(['/crm/contact_short'],], type=='json'))
defdef contactus((self,, question==None,, email==None,,
section_id==None,, ****kwargs):):
lead_values == {{
'name':: 'Lead from %s (Contact Snippet)' %% email,,
'description':: question,,
'email_from':: email,,
'section_id':: section_id,,
'user_id':: False,,
}}
returnreturn request..registry[['crm.lead']]..create((cr,, uid,, lead_values,,
context))
ThibaultDelavallée(tde@odoo.com)
Dynamic behavior
Bind Contact Us to the back-end
snippet..animationRegistry..contact == snippet..Animation..extend({({
start:: functionfunction ((editable_mode)) {{
thisthis..$(('.js_contact_btn').).on(('click',, functionfunction ((event)) {{
// perform verification
......
// json call to a route
returnreturn openerp..jsonRpc(('/crm/contact_short',, 'call',, {{
'section_id':: ++section_id,,
'email':: email,,
'question':: question,,
}).}).then((functionfunction ((result)) {{ ...... });});
});});
},},
});});
ThibaultDelavallée(tde@odoo.com)
And we are done !
Definition: an HTML body in
a template
Placement: XML declaration
Configuration: JS Option
Behavior: JS Animation
Link: Python controller and routes
·
·
·
·
·
ThibaultDelavallée(tde@odoo.com)
Thanks for your attention
Any questions ? tde@odoo.com / chm@odoo.com

More Related Content

What's hot

Chp6 - De UML vers C++
Chp6 - De UML vers C++Chp6 - De UML vers C++
Chp6 - De UML vers C++
Lilia Sfaxi
 
Presentation Symfony
Presentation SymfonyPresentation Symfony
Presentation Symfony
Jeremy Gachet
 
Odoo External API
Odoo External APIOdoo External API
Odoo External API
Odoo
 
Simple présentation de Wordpress
Simple présentation de WordpressSimple présentation de Wordpress
Simple présentation de Wordpress
Olympe Tchibozo
 
Web Service API Odoo - android
Web Service API Odoo - androidWeb Service API Odoo - android
Web Service API Odoo - android
Mohamed aymen zairi
 
scaffold method odoo 16
scaffold method odoo 16scaffold method odoo 16
scaffold method odoo 16
Celine George
 
Support NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDBSupport NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDB
ENSET, Université Hassan II Casablanca
 
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
 
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
Abdelouahed Abdou
 
Configure Expiration Date on Product in Odoo 15
Configure Expiration Date on Product in Odoo 15Configure Expiration Date on Product in Odoo 15
Configure Expiration Date on Product in Odoo 15
Celine George
 
Odoo system presentation.pdf
Odoo system presentation.pdfOdoo system presentation.pdf
Odoo system presentation.pdf
Святослав Надозирний
 
How to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in OdooHow to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in Odoo
Odoo
 
View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
Celine George
 
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
Odoo
 
Les principes de base de PHP
 Les principes de base de PHP  Les principes de base de PHP
Les principes de base de PHP
EL JAOUARI Ahmed
 
Name Search() Function in Odoo 16
Name Search() Function in Odoo 16Name Search() Function in Odoo 16
Name Search() Function in Odoo 16
Celine 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 Mixins
Odoo
 
Sessions and cookies in php
Sessions and cookies in phpSessions and cookies in php
Sessions and cookies in php
Pavan b
 
How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15
Celine 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 Mixins
Odoo
 

What's hot (20)

Chp6 - De UML vers C++
Chp6 - De UML vers C++Chp6 - De UML vers C++
Chp6 - De UML vers C++
 
Presentation Symfony
Presentation SymfonyPresentation Symfony
Presentation Symfony
 
Odoo External API
Odoo External APIOdoo External API
Odoo External API
 
Simple présentation de Wordpress
Simple présentation de WordpressSimple présentation de Wordpress
Simple présentation de Wordpress
 
Web Service API Odoo - android
Web Service API Odoo - androidWeb Service API Odoo - android
Web Service API Odoo - android
 
scaffold method odoo 16
scaffold method odoo 16scaffold method odoo 16
scaffold method odoo 16
 
Support NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDBSupport NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDB
 
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
 
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
Développement de modules pour odoo (anciennement OpenERP): exemples et exerci...
 
Configure Expiration Date on Product in Odoo 15
Configure Expiration Date on Product in Odoo 15Configure Expiration Date on Product in Odoo 15
Configure Expiration Date on Product in Odoo 15
 
Odoo system presentation.pdf
Odoo system presentation.pdfOdoo system presentation.pdf
Odoo system presentation.pdf
 
How to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in OdooHow to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in Odoo
 
View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
 
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
 
Les principes de base de PHP
 Les principes de base de PHP  Les principes de base de PHP
Les principes de base de PHP
 
Name Search() Function in Odoo 16
Name Search() Function in Odoo 16Name Search() Function in Odoo 16
Name Search() Function in Odoo 16
 
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
 
Sessions and cookies in php
Sessions and cookies in phpSessions and cookies in php
Sessions and cookies in php
 
How to Build Custom Module in Odoo 15
How to Build Custom Module in Odoo 15How to Build Custom Module in Odoo 15
How to Build Custom Module in 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
 

Similar to Odoo - CMS dynamic widgets

Building beautiful websites with bootstrap a case study (DevelopMentor webcast)
Building beautiful websites with bootstrap  a case study (DevelopMentor webcast)Building beautiful websites with bootstrap  a case study (DevelopMentor webcast)
Building beautiful websites with bootstrap a case study (DevelopMentor webcast)
Michael Kennedy
 
Rapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websitesRapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websites
Chetan Giridhar
 
Add Clarity to Communications to Delight Customers
Add Clarity to Communications to Delight CustomersAdd Clarity to Communications to Delight Customers
Add Clarity to Communications to Delight Customers
Precisely
 
Modifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users groupModifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users group
Evan Mullins
 
Chapter3b McHaney 2nd edition
Chapter3b McHaney 2nd editionChapter3b McHaney 2nd edition
Chapter3b McHaney 2nd edition
Roger McHaney
 
Monetate Implementation Cheat Sheet
Monetate Implementation Cheat SheetMonetate Implementation Cheat Sheet
Monetate Implementation Cheat Sheet
Phil Pearce
 
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRMAdxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
Cynoteck Technology Solutions Private Limited
 
WordPress Basics
WordPress BasicsWordPress Basics
WordPress Basics
Michelle Ames
 
Miva ReadyThemes for Store Owners
Miva ReadyThemes for Store OwnersMiva ReadyThemes for Store Owners
Miva ReadyThemes for Store Owners
Miva
 
Advantages & Disadvantages of Wordpress
Advantages & Disadvantages of WordpressAdvantages & Disadvantages of Wordpress
Advantages & Disadvantages of Wordpress
Xithi Technologies
 
Employee Community
Employee CommunityEmployee Community
Employee Community
Cloud Analogy
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with selenium
Xebia IT Architects
 
Nabdslide
NabdslideNabdslide
Nabdslide
Sarah Gracia
 
TopicHero Descriptions Tutorial
TopicHero Descriptions TutorialTopicHero Descriptions Tutorial
TopicHero Descriptions Tutorial
Justin Coven, Ph.D.
 
Introduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.jsIntroduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.js
monterail
 
Desk.Com
Desk.ComDesk.Com
Desk.Com
Cloud Analogy
 
Official Presentation
Official PresentationOfficial Presentation
Official PresentationAjay Yadav
 
WordCamp Praga 2015
WordCamp Praga 2015WordCamp Praga 2015
WordCamp Praga 2015
Tomasz Dziuda
 

Similar to Odoo - CMS dynamic widgets (20)

Building beautiful websites with bootstrap a case study (DevelopMentor webcast)
Building beautiful websites with bootstrap  a case study (DevelopMentor webcast)Building beautiful websites with bootstrap  a case study (DevelopMentor webcast)
Building beautiful websites with bootstrap a case study (DevelopMentor webcast)
 
Rapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websitesRapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websites
 
Add Clarity to Communications to Delight Customers
Add Clarity to Communications to Delight CustomersAdd Clarity to Communications to Delight Customers
Add Clarity to Communications to Delight Customers
 
Modifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users groupModifying your themes design - Learning CSS - Atlanta WordPress users group
Modifying your themes design - Learning CSS - Atlanta WordPress users group
 
Chapter3b McHaney
Chapter3b McHaneyChapter3b McHaney
Chapter3b McHaney
 
Chapter3b McHaney 2nd edition
Chapter3b McHaney 2nd editionChapter3b McHaney 2nd edition
Chapter3b McHaney 2nd edition
 
Monetate Implementation Cheat Sheet
Monetate Implementation Cheat SheetMonetate Implementation Cheat Sheet
Monetate Implementation Cheat Sheet
 
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRMAdxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
Adxstudio Portals provide solutions to access webpage for Microsoft dynamics CRM
 
WordPress Basics
WordPress BasicsWordPress Basics
WordPress Basics
 
Miva ReadyThemes for Store Owners
Miva ReadyThemes for Store OwnersMiva ReadyThemes for Store Owners
Miva ReadyThemes for Store Owners
 
Web-First Design Patterns
Web-First Design PatternsWeb-First Design Patterns
Web-First Design Patterns
 
Advantages & Disadvantages of Wordpress
Advantages & Disadvantages of WordpressAdvantages & Disadvantages of Wordpress
Advantages & Disadvantages of Wordpress
 
Employee Community
Employee CommunityEmployee Community
Employee Community
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with selenium
 
Nabdslide
NabdslideNabdslide
Nabdslide
 
TopicHero Descriptions Tutorial
TopicHero Descriptions TutorialTopicHero Descriptions Tutorial
TopicHero Descriptions Tutorial
 
Introduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.jsIntroduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.js
 
Desk.Com
Desk.ComDesk.Com
Desk.Com
 
Official Presentation
Official PresentationOfficial Presentation
Official Presentation
 
WordCamp Praga 2015
WordCamp Praga 2015WordCamp Praga 2015
WordCamp Praga 2015
 

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
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & Strategy
Odoo
 
Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14
Odoo
 
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
Odoo
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with Odoo
Odoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use Case
Odoo
 
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 Operations
Odoo
 
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
Odoo
 
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
Odoo
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with Odoo
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
 
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
Odoo
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to Odoo
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
Odoo
 
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 Label
Odoo
 
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
Odoo
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to Odoo
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
Odoo
 

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!
 
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
 

Recently uploaded

SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Odoo - CMS dynamic widgets

  • 1. CMS Dynamic Widgets Thibault Delavallée, R&D Engineer
  • 3. Dynamic widgets Widgets, Snippets -> CMS building blocks Dynamic widgets: Discussion Groups, Mailing Lists ThibaultDelavallée(tde@odoo.com)
  • 4. Dynamic widgets Efficient and simple way to customize your website Integrates with Odoo apps: subscribe to a discussion group, create leads, fill issues, ... Use the full power of odoo · · · ThibaultDelavallée(tde@odoo.com)
  • 5. Show me the stuff ! Running example: Contact WidgetContact Widget small contact form create leads from questions drag 'n drop it anywhere usefull · · · ThibaultDelavallée(tde@odoo.com)
  • 7. Talk structure Running example: Contact Widget body, content addition in CMS editor dynamic configuration: choosing the sales team link with backend: linking the button to the lead creation · · · · ThibaultDelavallée(tde@odoo.com)
  • 8. Body: widget content Body = HTMLHTML + CSSCSS (bootstrap) a (hidden) sales team a question an email a submit button <input<input type="hidden" name="section_id" value="0"/>/> <textarea<textarea name="description"></textarea>></textarea> <div<div class="input-group">> <input<input type="email" name="email_from"/>/> <button<button type="submit">>Contact Us</button></button> </div></div> · · · · ThibaultDelavallée(tde@odoo.com)
  • 9. Addition in Editor Snippets ? QWeb template ! <?xml version="1.0" encoding="utf-8"?> <openerp><openerp> <data><data> <template<template id="snippets">> <!-- here be snippets by categories --> ... </template></template> </data></data> </openerp></openerp> ThibaultDelavallée(tde@odoo.com)
  • 10. Addition in Editor Snippet addition: extend the editor QWeb template <template<template id="contact_snippet" name="Contact Snippet" inherit_id="website.snippets">> <xpath<xpath expr="//div[@id='snippet_feature']" position="inside">> <!-- begin snippet declaration --> <div><div> ... </div></div> <!-- end of snippet declaration --> </xpath></xpath> </template></template> ThibaultDelavallée(tde@odoo.com)
  • 11. Addition in Editor thumbnail: icon in editor <xpath<xpath expr="//div[@id='snippet_feature']" position="inside">> ... <div<div class="oe_snippet_thumbnail">> <img<img class="oe_snippet_thumbnail_img" src="/images/icon.png"/>/> <span<span class="oe_snippet_thumbnail_title">>Contact Snippet</span></span> </div></div> </xpath></xpath> body of the snippet <xpath<xpath expr="//div[@id='snippet_feature']" position="inside">> ... <section<section class="oe_snippet_body js_contact">> <!-- snippet HTML content --> </section></section> </xpath></xpath> · · ThibaultDelavallée(tde@odoo.com)
  • 12. Snippet options placement: data-selector-... menu option: li, option menu entry <div<div data-snippet-option-id='contact_snippet' data-selector=".js_contact" data-selector-siblings="p, h1, h2, h3, blockquote, div, .well, .panel">> <li><li> <a<a href="#" class="button js_contact_sales_team">> Change Sales Team </a></a> </li></li> </div></div> · · ThibaultDelavallée(tde@odoo.com)
  • 14. Dynamic customize Customize menu To link with ThibaultDelavallée(tde@odoo.com)
  • 15. Dynamic customize Add a snippet.Option to add dynamic configuration Example: Discussion Group choice, Sales Team choice, ... snippet..options..contact_snippet == snippet..Option..extend({({ on_prompt:: functionfunction ()() {{ returnreturn website..prompt({({ window_title:: _t(("Add a Contact Snippet"),), init:: functionfunction ((field)) {{ returnreturn website..session..model(('crm.case.section')) ..call(('name_search',, [['',, []])},[]])}, }).}).then((functionfunction ((sales_team_id)) {{ self..$(('.js_section_id').).attr(("value",, sales_team_id);); });}); }} });}); ThibaultDelavallée(tde@odoo.com)
  • 16. Link with back-end To contact the back-end: define a new routeroute Route: URL -> action performed by server Defined in Python, in a controller classclass ContactUsShort((http..Controller):): # define my custom controller @http.route@http.route(('/my/route',, ......)) defdef my_route((......):): {http://myodoo.com/}crm/contact_short will be a route creating a lead from data coming from the form · · ThibaultDelavallée(tde@odoo.com)
  • 17. Link with back-end crm/contact_short definition @http.route@http.route([(['/crm/contact_short'],], type=='json')) defdef contactus((self,, question==None,, email==None,, section_id==None,, ****kwargs):): lead_values == {{ 'name':: 'Lead from %s (Contact Snippet)' %% email,, 'description':: question,, 'email_from':: email,, 'section_id':: section_id,, 'user_id':: False,, }} returnreturn request..registry[['crm.lead']]..create((cr,, uid,, lead_values,, context)) ThibaultDelavallée(tde@odoo.com)
  • 18. Dynamic behavior Bind Contact Us to the back-end snippet..animationRegistry..contact == snippet..Animation..extend({({ start:: functionfunction ((editable_mode)) {{ thisthis..$(('.js_contact_btn').).on(('click',, functionfunction ((event)) {{ // perform verification ...... // json call to a route returnreturn openerp..jsonRpc(('/crm/contact_short',, 'call',, {{ 'section_id':: ++section_id,, 'email':: email,, 'question':: question,, }).}).then((functionfunction ((result)) {{ ...... });}); });}); },}, });}); ThibaultDelavallée(tde@odoo.com)
  • 19. And we are done ! Definition: an HTML body in a template Placement: XML declaration Configuration: JS Option Behavior: JS Animation Link: Python controller and routes · · · · · ThibaultDelavallée(tde@odoo.com)
  • 20. Thanks for your attention Any questions ? tde@odoo.com / chm@odoo.com