SlideShare a Scribd company logo
1 of 27
Download to read offline
From a web controller to a full
CMS
Martin Geubelle • Developper
From Hello World to Hello Wow!
EXPERIENCE
2018
Website, editor and themes1
Development on Website: the Snippet
Snippet options
2
3
The complete code: https://github.com/mge-odoo/oxp2018
Website, editor &
themes1
Website, editor & themes (1)
Make your page “website editable”
Website, editor & themes (1)
Make your page “website editable”
{
'name': 'Plant Nursery',
'version': '1.0',
…
'depends': ['web', … 'website'],
}
● Add website dependency
○ __manifest__.py
Website, editor & themes (2)
Make your page “website editable”
@route('/coucou/…/plants')
def plants(self, … website=True):
# do stuff
return request.render("plants", values)
● Add website dependency
● Modify controller
○ template context values
Website, editor & themes (3)
Make your page “website editable”
● Add website dependency
● Modify controller
● Modify frontend layout
○ call website.layout
○ add oe_structure
<template id="plant" name="Hello Wow">
<t t-call="website.layout">
<div class="oe_structure" id="oe_structure_plant_nursery_plant_1"/>
<!-- previous plants template -->
</t>
</template>
● It’s done!
○ Create new pages
○ Install a “theme_” module
○ Have fun while customizing your website
■ https://www.youtube.com/watch?v=351Da7Qx0IQ
○ And much more…
Website, editor & themes (4)
Make your page “website editable”
Website, editor & themes (4)
Development on
Website: the Snippet2
Snippet (1)
(or Building Block)
● “A short reusable piece of computer code” [Wikipedia]
● Draggable & droppable
● Template in a qWeb view
● Behaviour in a JavaScript module
● Extension of its parent “the Widget”
Snippet (2)
Use Case: Plants in Promotion
Snippet (3)
The Snippets menu
<template id="snippet_promo_plant" inherit_id="website.snippets">
<xpath expr="//div[@id='snippet_effect']/div[contains(@class, 'o_panel_body')]" position="inside">
<t t-snippet="plant_nursery.s_promo_plants" t-thumbnail="/plant_nursery/static/…./icon.png"/>
</xpath>
</template>
Snippet (4)
The Snippet template
<template id="promo_plants" name="Plants in Promotion">
<section class="s_promo_plants">
<div class="container">
<div class="row"/>
</div>
</section>
</template>
● Basic template
○ extended dynamically in JS
○ use a unique class (later called “the selector”)
Snippet (5)
The Snippets behaviour
● Add to snippets registry
odoo.define('plant_nursery.snippets.animation', function (require) {
var sAnimation = require('website.content.snippets.animation');
var sPromoPlant = sAnimation.Class.extend({ … });
sAnimation.registry.sPromoPlant = PromoPlant;
});
Snippet (6)
The Snippets behaviour
● Add to snippets registry
● Extend website.content.snippets.animation
○ selector key (from the template)
○ Widget lifecyle: init, willStart, start, destroy
odoo.define('plant_nursery.snippets.animation', function (require) {
var sAnimation = require('website.content.snippets.animation');
var PromoPlants = sAnimation.Class.extend({
selector: ".s_promo_plants",
init: function () { … },
willStart: function () { … },
start: function () { … },
destroy: function () { … },
});
});
Snippet (7)
The Snippets behaviour
odoo.define('plant_nursery.snippets.animation', function (require) {
var sPromoPlant = sAnimation.Class.extend({
willStart: function () {
return this._rpc({
model: 'plant.plant',
method: 'search_read',
domain: [['promo', '=', true]],
fields: […],
}).then(function (result) { // do stuff with result });
},
});
});
● Add to snippets registry
● Extend website.content.snippets.animation
● Load plants (rpc)
Snippet (8)
The Snippets behaviour
odoo.define('plant_nursery.snippets.animation', function (require) {
var sPromoPlant = sAnimation.Class.extend({
xmlDependencies: ['/plant_nursery/static/src/xml/animation.xml'],
start: function () {
this.$('.row').append(core.qweb.render('plant_nursery.promo_plants', {plants: result}));
},
});
});
● Add to snippets registry
● Extend website.content.snippets.animation
● Load plants (rpc)
● Render the static content
Snippet options3
Snippet options (1)
The “edition” mode
Snippet options (2)
The option template
● Template in qWeb
○ data-js: snippet name in registry
○ data-selector: same selector as previously
<template id="snippet_promo_plant_options" inherit_id="website.snippet_options">
<xpath expr="." position="inside">
<div data-js="sPromoPlant" data-selector=".s_promo_plants">
<div class="dropdown-submenu">
<a href="#">Number of plants</a>
<div class="dropdown-menu">
<a data-limit="1" class="dropdown-item" href="#">1</a>
<a data-limit="2" class="dropdown-item" href="#">2</a>
…
</div>
</xpath>
</template>
Snippet options (3)
The Snippet editor
● Extend web_editor.snippets.options
odoo.define('plant_nursery.snippets.editor, function (require) {
var sOptions = require('web_editor.snippets.options');
var PromoPlants = sOptions.Class.extend({
start: function () { … },
cleanForSave: function () { … },
});
});
Snippet options (4)
The Snippet editor
● Extend web_editor.snippets.options
● limit function to set the data on the $target (the Snippet)
odoo.define('plant_nursery.snippets.editor, function (require) {
var sOptions = require('web_editor.snippets.options');
var PromoPlants = sOptions.Class.extend({
// ...
limit: function () {
this.$target.attr('data-limit', value);
},
});
});
Snippet options (6)
The Snippet editor
● Extend web_editor.snippets.options
● limit function to set the data on the $target (the snippet)
● Use limit option in Snippet
odoo.define('plant_nursery.snippets.animation', function (require) {
var sPromoPlant = sAnimation.Class.extend({
willStart: function () {
return this._rpc({
model: 'plant.plant',
method: 'search_read',
domain: [['promo', '=', true]],
fields: […],
limit: this.$el.data('limit'),
}).then(function (result) { // do stuff with result });
});
});
“We want more …”
● Options can be set anywhere
● Effects API (wow!)
● A lot of available snippets (Google Maps, Twitter, etc.)
● An amazing on-the-fly editor
○ HTML
○ CSS
● Your endless imagination
We want more
Thank you.
#odooexperience
2018
Any questions?
EXPERIENCE
2018

More Related Content

What's hot

날로 먹는 Django admin 활용
날로 먹는 Django admin 활용날로 먹는 Django admin 활용
날로 먹는 Django admin 활용KyeongMook "Kay" Cha
 
Make your App Frontend Compatible
Make your App Frontend CompatibleMake your App Frontend Compatible
Make your App Frontend CompatibleOdoo
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
Flask 소수전공 강의자료 - 3차시
Flask 소수전공 강의자료 - 3차시Flask 소수전공 강의자료 - 3차시
Flask 소수전공 강의자료 - 3차시Junha Jang
 
Flask 소수전공 강의자료 - 4차시
Flask 소수전공 강의자료 - 4차시Flask 소수전공 강의자료 - 4차시
Flask 소수전공 강의자료 - 4차시Junha Jang
 
MTDDC Meetup TOKYO 2016
MTDDC Meetup TOKYO 2016MTDDC Meetup TOKYO 2016
MTDDC Meetup TOKYO 2016bitpart
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowkatbailey
 
Nuxeo World Session: Layouts and Content Views
Nuxeo World Session: Layouts and Content ViewsNuxeo World Session: Layouts and Content Views
Nuxeo World Session: Layouts and Content ViewsNuxeo
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extensionHendy Irawan
 
How to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHow to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHendy Irawan
 
"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил АнохинFwdays
 
Xml operations in odoo
Xml operations in odooXml operations in odoo
Xml operations in odooCeline George
 
Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Fwdays
 
Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryPamela Fox
 
Writing Drupal 5 Module
Writing Drupal 5 ModuleWriting Drupal 5 Module
Writing Drupal 5 ModuleSammy Fung
 
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
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal DevelopmentJeff Eaton
 

What's hot (20)

날로 먹는 Django admin 활용
날로 먹는 Django admin 활용날로 먹는 Django admin 활용
날로 먹는 Django admin 활용
 
Make your App Frontend Compatible
Make your App Frontend CompatibleMake your App Frontend Compatible
Make your App Frontend Compatible
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Flask 소수전공 강의자료 - 3차시
Flask 소수전공 강의자료 - 3차시Flask 소수전공 강의자료 - 3차시
Flask 소수전공 강의자료 - 3차시
 
Flask 소수전공 강의자료 - 4차시
Flask 소수전공 강의자료 - 4차시Flask 소수전공 강의자료 - 4차시
Flask 소수전공 강의자료 - 4차시
 
MTDDC Meetup TOKYO 2016
MTDDC Meetup TOKYO 2016MTDDC Meetup TOKYO 2016
MTDDC Meetup TOKYO 2016
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to know
 
Nuxeo World Session: Layouts and Content Views
Nuxeo World Session: Layouts and Content ViewsNuxeo World Session: Layouts and Content Views
Nuxeo World Session: Layouts and Content Views
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency Injection
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extension
 
How to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHow to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento Extension
 
"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Xml operations in odoo
Xml operations in odooXml operations in odoo
Xml operations in odoo
 
Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"
 
Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & Witchery
 
Writing Drupal 5 Module
Writing Drupal 5 ModuleWriting Drupal 5 Module
Writing Drupal 5 Module
 
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
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 

Similar to Odoo Experience 2018 - From a Web Controller to a Full CMS

Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressJesse James Arnold
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction DjangoWade Austin
 
May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014Chad Windnagle
 
Develop an App with the Odoo Framework
Develop an App with the Odoo FrameworkDevelop an App with the Odoo Framework
Develop an App with the Odoo FrameworkOdoo
 
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
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstartLinkMe Srl
 
Bootstrap Web Development Framework
Bootstrap Web Development FrameworkBootstrap Web Development Framework
Bootstrap Web Development FrameworkCindy Royal
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Mark Leusink
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletonGeorge Nguyen
 

Similar to Odoo Experience 2018 - From a Web Controller to a Full CMS (20)

Design Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPressDesign Systems, Pattern Libraries & WordPress
Design Systems, Pattern Libraries & WordPress
 
Bootstrap with liferay
Bootstrap with liferayBootstrap with liferay
Bootstrap with liferay
 
Django web framework
Django web frameworkDjango web framework
Django web framework
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014
 
Develop an App with the Odoo Framework
Develop an App with the Odoo FrameworkDevelop an App with the Odoo Framework
Develop an App with the Odoo Framework
 
Django crush course
Django crush course Django crush course
Django crush course
 
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)
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
 
Bootstrap Web Development Framework
Bootstrap Web Development FrameworkBootstrap Web Development Framework
Bootstrap Web Development Framework
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Django
DjangoDjango
Django
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 

More from ElínAnna Jónasdóttir

Odoo Experience 2018 - Connect Your PoS to Hardware
Odoo Experience 2018 - Connect Your PoS to HardwareOdoo Experience 2018 - Connect Your PoS to Hardware
Odoo Experience 2018 - Connect Your PoS to HardwareElínAnna Jónasdóttir
 
Odoo Experience 2018 - Odoo Studio as a Prototyping Tool
Odoo Experience 2018 - Odoo Studio as a Prototyping ToolOdoo Experience 2018 - Odoo Studio as a Prototyping Tool
Odoo Experience 2018 - Odoo Studio as a Prototyping ToolElínAnna Jónasdóttir
 
Odoo Experience 2018 - Odoo Studio: A Functional Approach
Odoo Experience 2018 - Odoo Studio: A Functional ApproachOdoo Experience 2018 - Odoo Studio: A Functional Approach
Odoo Experience 2018 - Odoo Studio: A Functional ApproachElínAnna Jónasdóttir
 
Odoo Experience 2018 - GDPR: How Odoo Can Help You with Complieance
Odoo Experience 2018 - GDPR: How Odoo Can Help You with ComplieanceOdoo Experience 2018 - GDPR: How Odoo Can Help You with Complieance
Odoo Experience 2018 - GDPR: How Odoo Can Help You with ComplieanceElínAnna Jónasdóttir
 
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)ElínAnna Jónasdóttir
 
Odoo Experience 2018 - Multi-Channel Sales: The Future of Retail
Odoo Experience 2018 - Multi-Channel Sales: The Future of RetailOdoo Experience 2018 - Multi-Channel Sales: The Future of Retail
Odoo Experience 2018 - Multi-Channel Sales: The Future of RetailElínAnna Jónasdóttir
 
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-Ups
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-UpsOdoo Experience 2018 - Speed Up Credit Collection with Automated Follow-Ups
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-UpsElínAnna Jónasdóttir
 
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with Odoo
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with OdooOdoo Experience 2018 - Improve Your Visibility and Prospect Better with Odoo
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with OdooElínAnna Jónasdóttir
 
Odoo Experience 2018 - Organize Your Operations in a Startup Environment
Odoo Experience 2018 - Organize Your Operations in a Startup EnvironmentOdoo Experience 2018 - Organize Your Operations in a Startup Environment
Odoo Experience 2018 - Organize Your Operations in a Startup EnvironmentElínAnna Jónasdóttir
 
Odoo Experience 2018 - Best Practices to Close Deals
Odoo Experience 2018 - Best Practices to Close DealsOdoo Experience 2018 - Best Practices to Close Deals
Odoo Experience 2018 - Best Practices to Close DealsElínAnna Jónasdóttir
 
Odoo Experience 2018 - Customer Success Team: How Do We Work?
Odoo Experience 2018 - Customer Success Team: How Do We Work?Odoo Experience 2018 - Customer Success Team: How Do We Work?
Odoo Experience 2018 - Customer Success Team: How Do We Work?ElínAnna Jónasdóttir
 
Odoo Experience 2018 - Customer Success Team: Meet our Experts
Odoo Experience 2018 - Customer Success Team: Meet our ExpertsOdoo Experience 2018 - Customer Success Team: Meet our Experts
Odoo Experience 2018 - Customer Success Team: Meet our ExpertsElínAnna Jónasdóttir
 
Odoo Experience 2018 - How a Feedback Loop Helps to Fine-Tune Your Manufactu...
Odoo Experience 2018 -  How a Feedback Loop Helps to Fine-Tune Your Manufactu...Odoo Experience 2018 -  How a Feedback Loop Helps to Fine-Tune Your Manufactu...
Odoo Experience 2018 - How a Feedback Loop Helps to Fine-Tune Your Manufactu...ElínAnna Jónasdóttir
 
Odoo Experience 2018 - Successful Import of Big Data with an Efficient Tool
Odoo Experience 2018 - Successful Import of Big Data with an Efficient ToolOdoo Experience 2018 - Successful Import of Big Data with an Efficient Tool
Odoo Experience 2018 - Successful Import of Big Data with an Efficient ToolElínAnna Jónasdóttir
 
Odoo Experience 2018 - Inventory: Advanced Flow with the New Barcode
Odoo Experience 2018 - Inventory: Advanced Flow with the New BarcodeOdoo Experience 2018 - Inventory: Advanced Flow with the New Barcode
Odoo Experience 2018 - Inventory: Advanced Flow with the New BarcodeElínAnna Jónasdóttir
 
Odoo Experience 2018 - Easypost: New Shipping Connector
Odoo Experience 2018 - Easypost: New Shipping Connector Odoo Experience 2018 - Easypost: New Shipping Connector
Odoo Experience 2018 - Easypost: New Shipping Connector ElínAnna Jónasdóttir
 
Odoo Experience 2018 - Project Methodology: The Editor Stance
Odoo Experience 2018 - Project Methodology: The Editor StanceOdoo Experience 2018 - Project Methodology: The Editor Stance
Odoo Experience 2018 - Project Methodology: The Editor StanceElínAnna Jónasdóttir
 
Odoo Experience 2018 - Grow Your Business with In-App Purchases
Odoo Experience 2018 -  Grow Your Business with In-App PurchasesOdoo Experience 2018 -  Grow Your Business with In-App Purchases
Odoo Experience 2018 - Grow Your Business with In-App PurchasesElínAnna Jónasdóttir
 
Odoo Experience 2018 - All You Need to Know About Odoo's Partnership
Odoo Experience 2018 - All You Need to Know About Odoo's PartnershipOdoo Experience 2018 - All You Need to Know About Odoo's Partnership
Odoo Experience 2018 - All You Need to Know About Odoo's PartnershipElínAnna Jónasdóttir
 
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?ElínAnna Jónasdóttir
 

More from ElínAnna Jónasdóttir (20)

Odoo Experience 2018 - Connect Your PoS to Hardware
Odoo Experience 2018 - Connect Your PoS to HardwareOdoo Experience 2018 - Connect Your PoS to Hardware
Odoo Experience 2018 - Connect Your PoS to Hardware
 
Odoo Experience 2018 - Odoo Studio as a Prototyping Tool
Odoo Experience 2018 - Odoo Studio as a Prototyping ToolOdoo Experience 2018 - Odoo Studio as a Prototyping Tool
Odoo Experience 2018 - Odoo Studio as a Prototyping Tool
 
Odoo Experience 2018 - Odoo Studio: A Functional Approach
Odoo Experience 2018 - Odoo Studio: A Functional ApproachOdoo Experience 2018 - Odoo Studio: A Functional Approach
Odoo Experience 2018 - Odoo Studio: A Functional Approach
 
Odoo Experience 2018 - GDPR: How Odoo Can Help You with Complieance
Odoo Experience 2018 - GDPR: How Odoo Can Help You with ComplieanceOdoo Experience 2018 - GDPR: How Odoo Can Help You with Complieance
Odoo Experience 2018 - GDPR: How Odoo Can Help You with Complieance
 
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)
Odoo Experience 2018 - How to Break Odoo Security (or how to prevent it)
 
Odoo Experience 2018 - Multi-Channel Sales: The Future of Retail
Odoo Experience 2018 - Multi-Channel Sales: The Future of RetailOdoo Experience 2018 - Multi-Channel Sales: The Future of Retail
Odoo Experience 2018 - Multi-Channel Sales: The Future of Retail
 
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-Ups
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-UpsOdoo Experience 2018 - Speed Up Credit Collection with Automated Follow-Ups
Odoo Experience 2018 - Speed Up Credit Collection with Automated Follow-Ups
 
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with Odoo
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with OdooOdoo Experience 2018 - Improve Your Visibility and Prospect Better with Odoo
Odoo Experience 2018 - Improve Your Visibility and Prospect Better with Odoo
 
Odoo Experience 2018 - Organize Your Operations in a Startup Environment
Odoo Experience 2018 - Organize Your Operations in a Startup EnvironmentOdoo Experience 2018 - Organize Your Operations in a Startup Environment
Odoo Experience 2018 - Organize Your Operations in a Startup Environment
 
Odoo Experience 2018 - Best Practices to Close Deals
Odoo Experience 2018 - Best Practices to Close DealsOdoo Experience 2018 - Best Practices to Close Deals
Odoo Experience 2018 - Best Practices to Close Deals
 
Odoo Experience 2018 - Customer Success Team: How Do We Work?
Odoo Experience 2018 - Customer Success Team: How Do We Work?Odoo Experience 2018 - Customer Success Team: How Do We Work?
Odoo Experience 2018 - Customer Success Team: How Do We Work?
 
Odoo Experience 2018 - Customer Success Team: Meet our Experts
Odoo Experience 2018 - Customer Success Team: Meet our ExpertsOdoo Experience 2018 - Customer Success Team: Meet our Experts
Odoo Experience 2018 - Customer Success Team: Meet our Experts
 
Odoo Experience 2018 - How a Feedback Loop Helps to Fine-Tune Your Manufactu...
Odoo Experience 2018 -  How a Feedback Loop Helps to Fine-Tune Your Manufactu...Odoo Experience 2018 -  How a Feedback Loop Helps to Fine-Tune Your Manufactu...
Odoo Experience 2018 - How a Feedback Loop Helps to Fine-Tune Your Manufactu...
 
Odoo Experience 2018 - Successful Import of Big Data with an Efficient Tool
Odoo Experience 2018 - Successful Import of Big Data with an Efficient ToolOdoo Experience 2018 - Successful Import of Big Data with an Efficient Tool
Odoo Experience 2018 - Successful Import of Big Data with an Efficient Tool
 
Odoo Experience 2018 - Inventory: Advanced Flow with the New Barcode
Odoo Experience 2018 - Inventory: Advanced Flow with the New BarcodeOdoo Experience 2018 - Inventory: Advanced Flow with the New Barcode
Odoo Experience 2018 - Inventory: Advanced Flow with the New Barcode
 
Odoo Experience 2018 - Easypost: New Shipping Connector
Odoo Experience 2018 - Easypost: New Shipping Connector Odoo Experience 2018 - Easypost: New Shipping Connector
Odoo Experience 2018 - Easypost: New Shipping Connector
 
Odoo Experience 2018 - Project Methodology: The Editor Stance
Odoo Experience 2018 - Project Methodology: The Editor StanceOdoo Experience 2018 - Project Methodology: The Editor Stance
Odoo Experience 2018 - Project Methodology: The Editor Stance
 
Odoo Experience 2018 - Grow Your Business with In-App Purchases
Odoo Experience 2018 -  Grow Your Business with In-App PurchasesOdoo Experience 2018 -  Grow Your Business with In-App Purchases
Odoo Experience 2018 - Grow Your Business with In-App Purchases
 
Odoo Experience 2018 - All You Need to Know About Odoo's Partnership
Odoo Experience 2018 - All You Need to Know About Odoo's PartnershipOdoo Experience 2018 - All You Need to Know About Odoo's Partnership
Odoo Experience 2018 - All You Need to Know About Odoo's Partnership
 
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?
Odoo Experience 2018 - How to Manage Accounting Firms with Odoo?
 

Recently uploaded

OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...marjmae69
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)Basil Achie
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !risocarla2016
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 

Recently uploaded (20)

OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 

Odoo Experience 2018 - From a Web Controller to a Full CMS

  • 1. From a web controller to a full CMS Martin Geubelle • Developper From Hello World to Hello Wow! EXPERIENCE 2018
  • 2. Website, editor and themes1 Development on Website: the Snippet Snippet options 2 3 The complete code: https://github.com/mge-odoo/oxp2018
  • 4. Website, editor & themes (1) Make your page “website editable”
  • 5. Website, editor & themes (1) Make your page “website editable” { 'name': 'Plant Nursery', 'version': '1.0', … 'depends': ['web', … 'website'], } ● Add website dependency ○ __manifest__.py
  • 6. Website, editor & themes (2) Make your page “website editable” @route('/coucou/…/plants') def plants(self, … website=True): # do stuff return request.render("plants", values) ● Add website dependency ● Modify controller ○ template context values
  • 7. Website, editor & themes (3) Make your page “website editable” ● Add website dependency ● Modify controller ● Modify frontend layout ○ call website.layout ○ add oe_structure <template id="plant" name="Hello Wow"> <t t-call="website.layout"> <div class="oe_structure" id="oe_structure_plant_nursery_plant_1"/> <!-- previous plants template --> </t> </template>
  • 8. ● It’s done! ○ Create new pages ○ Install a “theme_” module ○ Have fun while customizing your website ■ https://www.youtube.com/watch?v=351Da7Qx0IQ ○ And much more… Website, editor & themes (4) Make your page “website editable”
  • 9. Website, editor & themes (4)
  • 11. Snippet (1) (or Building Block) ● “A short reusable piece of computer code” [Wikipedia] ● Draggable & droppable ● Template in a qWeb view ● Behaviour in a JavaScript module ● Extension of its parent “the Widget”
  • 12. Snippet (2) Use Case: Plants in Promotion
  • 13. Snippet (3) The Snippets menu <template id="snippet_promo_plant" inherit_id="website.snippets"> <xpath expr="//div[@id='snippet_effect']/div[contains(@class, 'o_panel_body')]" position="inside"> <t t-snippet="plant_nursery.s_promo_plants" t-thumbnail="/plant_nursery/static/…./icon.png"/> </xpath> </template>
  • 14. Snippet (4) The Snippet template <template id="promo_plants" name="Plants in Promotion"> <section class="s_promo_plants"> <div class="container"> <div class="row"/> </div> </section> </template> ● Basic template ○ extended dynamically in JS ○ use a unique class (later called “the selector”)
  • 15. Snippet (5) The Snippets behaviour ● Add to snippets registry odoo.define('plant_nursery.snippets.animation', function (require) { var sAnimation = require('website.content.snippets.animation'); var sPromoPlant = sAnimation.Class.extend({ … }); sAnimation.registry.sPromoPlant = PromoPlant; });
  • 16. Snippet (6) The Snippets behaviour ● Add to snippets registry ● Extend website.content.snippets.animation ○ selector key (from the template) ○ Widget lifecyle: init, willStart, start, destroy odoo.define('plant_nursery.snippets.animation', function (require) { var sAnimation = require('website.content.snippets.animation'); var PromoPlants = sAnimation.Class.extend({ selector: ".s_promo_plants", init: function () { … }, willStart: function () { … }, start: function () { … }, destroy: function () { … }, }); });
  • 17. Snippet (7) The Snippets behaviour odoo.define('plant_nursery.snippets.animation', function (require) { var sPromoPlant = sAnimation.Class.extend({ willStart: function () { return this._rpc({ model: 'plant.plant', method: 'search_read', domain: [['promo', '=', true]], fields: […], }).then(function (result) { // do stuff with result }); }, }); }); ● Add to snippets registry ● Extend website.content.snippets.animation ● Load plants (rpc)
  • 18. Snippet (8) The Snippets behaviour odoo.define('plant_nursery.snippets.animation', function (require) { var sPromoPlant = sAnimation.Class.extend({ xmlDependencies: ['/plant_nursery/static/src/xml/animation.xml'], start: function () { this.$('.row').append(core.qweb.render('plant_nursery.promo_plants', {plants: result})); }, }); }); ● Add to snippets registry ● Extend website.content.snippets.animation ● Load plants (rpc) ● Render the static content
  • 20. Snippet options (1) The “edition” mode
  • 21. Snippet options (2) The option template ● Template in qWeb ○ data-js: snippet name in registry ○ data-selector: same selector as previously <template id="snippet_promo_plant_options" inherit_id="website.snippet_options"> <xpath expr="." position="inside"> <div data-js="sPromoPlant" data-selector=".s_promo_plants"> <div class="dropdown-submenu"> <a href="#">Number of plants</a> <div class="dropdown-menu"> <a data-limit="1" class="dropdown-item" href="#">1</a> <a data-limit="2" class="dropdown-item" href="#">2</a> … </div> </xpath> </template>
  • 22. Snippet options (3) The Snippet editor ● Extend web_editor.snippets.options odoo.define('plant_nursery.snippets.editor, function (require) { var sOptions = require('web_editor.snippets.options'); var PromoPlants = sOptions.Class.extend({ start: function () { … }, cleanForSave: function () { … }, }); });
  • 23. Snippet options (4) The Snippet editor ● Extend web_editor.snippets.options ● limit function to set the data on the $target (the Snippet) odoo.define('plant_nursery.snippets.editor, function (require) { var sOptions = require('web_editor.snippets.options'); var PromoPlants = sOptions.Class.extend({ // ... limit: function () { this.$target.attr('data-limit', value); }, }); });
  • 24. Snippet options (6) The Snippet editor ● Extend web_editor.snippets.options ● limit function to set the data on the $target (the snippet) ● Use limit option in Snippet odoo.define('plant_nursery.snippets.animation', function (require) { var sPromoPlant = sAnimation.Class.extend({ willStart: function () { return this._rpc({ model: 'plant.plant', method: 'search_read', domain: [['promo', '=', true]], fields: […], limit: this.$el.data('limit'), }).then(function (result) { // do stuff with result }); }); });
  • 25. “We want more …”
  • 26. ● Options can be set anywhere ● Effects API (wow!) ● A lot of available snippets (Google Maps, Twitter, etc.) ● An amazing on-the-fly editor ○ HTML ○ CSS ● Your endless imagination We want more