KEMBAR78
PPT. Introduction & Views - Documentation.pdf
TfFC Using Studio
1. Introduction & Views
Julien Domken - Business Analyst
Contents taken from LNA’s training.
SERVICES
2019
0. Welcome
About this training - WIIFY
● Goal :
○ Show the potential
○ Give a general understanding >< Being exhaustive (and exhausting !)
To make sure you have the tools you’ll need in your daily activities
TfFC Using Studio Agenda
1. Introduction & views
2. Automation & Access Rights
3. Reports
4. Create a new app
Introduction & Views
1. Introduction to Studio
2. Technical Concepts : Quick Refresher
3. Technical Concept : Views
4. Exercices
Introduction
1
Warning !
Elevator Pitch : Studio
● With vs Without Studio
● Test, Phase & Send to Production with only a few clicks (Studio
Module)
A few words on PM
Introduction
● The “Quickstart” Methodology
● The “80/20” rule
● Educate your SPOC
Odoo Studio :
3 Pitfalls to avoid to make your project a success
● Reinventing the wheel
● Customization vs Development
● Not focusing on the added value & the Business Need
I - Reinventing the wheel
Take a look at what exists…
… More than 45 apps & 400 modules...
… and no need to reinvent them !
Ex : Invoicing & Sales Order
The ‘Big Bang’
The ‘Creative’
I - Two approaches,
Same problem
II - Customization vs Development
“If a picture is worth a thousand words, sometimes a
development is worth a thousand customizations !”
Interface Change VS Business flow
Standard Automation VS Complex Process
Adapting VS Creating
II - Customization vs Development
III - Not focusing on added-value
● Is the technical cost worth it ?
○ Cost : time, money, complexity
● Does it impact a lot of users ?
○ Role distribution
● Why?
○ Why? Why? Why?...
III - Not focusing on added-value
● Does it ease the onboarding ?
○ Not Replicating
● Does it impact the business ?
○ Think business not Odoo
IV - All in all...
-> Studio and its technical limits
-> The limit you should set yourself/your customer
Technical Concepts :
Quick Refresher
2
PostgreSQL
DataBase server
ORM
(Object Relational Mapping)
Odoo Server
FrontEnd
Odoo Web
From a database to a UI
My Contacts (res.partner data table)
name country_id customer
Brandon Freeman United States TRUE
PostgreSQL
DataBase server
ORM
(Object Relational Mapping)
Odoo Server
FrontEnd
Odoo Web
My Contacts (res.partner data table)
name country_id customer
Brandon Freeman United States TRUE
Odoo Database Structure:
From a database to a UI
What is a database ?
Comparison with the Excel file
● Sheets are models
● Columns are fields
● Rows are records
id name city email
base.res_partner_1 ASUSTeK Taipei asusteK@yourcompany.example.com
base.res_partner_address_27 Arthur Gomez Taipei
base.res_partner_address_12 James Miller Taipei
base.res_partner_address_2 Joseph Walters Taipei joseph.walters@asustek.com
What is a database ?
Comparison with the Excel file
● Sheets are models
● Columns are fields
● Rows are records
id name city email
base.res_partner_1 ASUSTeK Taipei asusteK@yourcompany.example.com
base.res_partner_address_27 Arthur Gomez Taipei
base.res_partner_address_12 James Miller Taipei
base.res_partner_address_2 Joseph Walters Taipei joseph.walters@asustek.com
Models
Each Odoo model is a distinct translation of a business concept.
E.g. : An invoice, a sale order line, a customer.
But they can work together and have relationships through their fields
Fields
Fields are where the data is stored
Eg : Name, Status, Price, Weight, …
They have different types & features (e.g. : Date, Dropdown menu, …)
NB : Do not forget the naming conventions (“_id” & “_ids”)
Fields types
Text (char) Selection (selection)
Multi-line Text (text) HTML (html)
Integer number (integer) File (binary)
Decimal number (float) Many2One (many2one)
Date (date) One2many (one2many)
Date & time (datetime) Many2Many (many2many)
Checkbox (boolean)
Fields (types) + Widgets
Text (char) + Copyclipboardchar
Decimal number (float) + timefloat
Binary + image
Checkbox (boolean) + toogle_button
Relational fields
● M2O -> Many records pointing towards another
one.
● O2M -> Does not exist “per se”, reverse search
(M2O)
Many2One & One2Many
Relational fields
● M2M : Many records pointing
towards many records… And vice
versa !
● O2O : Does not exist in Odoo, use
M2O instead
Many2Many & One2One
Stored and not stored
● Is this information recorded in the DB or not?
→ YES: Stored
→ NO: Not stored
● All newly created fields are stored except the computed / related fields
→ To store them
● What if the field is not stored?
→ It’s not searchable
→ No Group by possible (not available in the pivot view)
→ Not usable in record rules (to be developed during the Access Rights session)
● Why should I store an information?
→ Performance
⇒ If you have any doubt, you can always ask to a technically skilled colleague
Stored and not stored
Menu items
● Menus allow to navigate through the differents models
Technical Concepts :
Studio & Views
3
Views
● Views are the interface that allows us to see the data in different
ways (a graph, a form, a calendar, …)
● Different view types exist and can be grouped in ‘families’
● The language used to create those views is (mostly) XML
● They’re stored in the database (Debug -> Technical -> Views)
Entity
● Some characters have special meaning in XML
● If you need to use them outside their initial use in the XML syntax, it will generate an error.
● To avoid these errors, replace the initial character with an entity reference
Entity reference Character Meaning
&lt; < Less than
&gt; > Greater than
&amp; & Ampersand
&apos; ‘ Apostrophe
&quot; “ Quotation mark
Basics of XML
Basics of XML
XML & Markup
● What does XML means?
● eXtensible Markup Language.
→ It’s a markup language just like HTML.
● Markup structure
○ All XML elements must have a closing tag.
○ XML tags are case sensitive
○ XML elements must be properly nested
○ XML can be commented
Element
● What is an XML element?
● It’s everything from the element’s start tag to the element’s end tag.
● An element can contain:
→ Attributes
→ Text
→ Other elements
→ A mix of the above
Basics of XML
Attribute
● What is an XML attribute?
● XML elements can have attributes that qualify them.
● XML attribute values must be quoted
Basics of XML
Views
How should you choose ?
● Different usages
○ The Search view support all views and allow to filter/group/search
○ Gantt is for forecasting
○ Pivot, Graphs, … are for reporting purposes
○ Grid is either for mass creation or reporting
Views
How should you choose ?
● Different usages
○ Form views are used to create / edit complex records
○ List views to either provide overviews, look for records or edit
simple records
○ Kanban view are built to support flows
General constraint :
A view is always based on a single model
● Contacts
● Opportunities
● Employees
● ...
Except… ?
Relational fields :
Example of a view showing several models
View inheritance and Studio
● Standard views and updates
● Creating Inherited views (xpaths)
● Studio
View Inheritance
● How an inherited view looks like?
○ A serie of change to be applied on the initial one.
● Main vs. Extension
○ A view can be modified by inherited view.
○ In our case, we’ll always build the inheritance by creating “Extension” views based on a
Main one
● Sequence
○ Odoo applies changes in a view respecting the sequence.
→ The bigger the sequence is, the later your change occurs in the view
● Change localization (WHERE)
○ XPATH vs. element
○ Keep it as simple as possible
● Positions (WHAT)
○ Before
○ After
○ Inside
Attributes
How to make a view dynamic
● The same field cannot have different behaviors => Solution ?
● Clearer UI
● Enforce a process (! user frustration)
Attributes
A whole set of other tools
● Domains
● Default values
● Context
● Placeholders
● ...
Attributes : A few examples
● Sale orders
● Attachment
● Studio conditional attrs
Odoo Studio Guided Tour
● Menus
● Views and options
● Fields and options (new and existing)
=> Explore
Main Elements in Odoo
● field
○ Display a field and its label.
● label
○ Give a label to another element.
● group
○ Gather elements within the same part of the screen.
1
2 3
4 5
Main Elements in Odoo
● button
○ Display a button.
● separator
○ Give a name to a section.
● notebook
○ Display a sub-section in the form view.
● page
○ Display a tab in a notebook.
Exercises
4
Industry 2
Business Need :
PLZ Pick-up the Phone© is a company active in the telemarketing industry. The main app they will work with
is the CRM. For reporting as well as micro-management purposes, they would like to keep track of every call
made by their employees.
The information they need are : WHO, WHEN, LENGTH OF THE CALL, STATUS, COMMENT
The different STATUS are : Sold, Asked to call back, Fake number, Refused
Of course, registering a new call should not erase the information from the previous one !
Functional Analysis :
On the opportunity :
● Create a new model “call report” and link it to opportunities
● Add a data table in a new tab which users can record their calls (date, length, status, comment) line
by line
● Users should be able to edit/create their reports on those lines
● A menu item should allow the managers to access all “reports” and to group/filter them
Technical Analysis : Feasible with Studio
Industry 3
Business Need :
His&Her© is a fashion company that will heavily use the Mass Mailing module to promote their new
catalogs. As such, they need to be sure of their customer gender (different campaigns). Moreover, they will
heavily use titles in their email openings (ex : Miss, Mister, …) and would like to clearly distinguish those
between genders (to avoid : Dear Miss John Smith).
For them, the titles are ordered in three categories (male, female, not defined).
Functional Analysis :
On the contacts
● Allow users to select a gender
● Make sure users can only select a title that matches the gender of the contact
● Both field should be mandatory as otherwise users won’t fill them in
● Make sure users do not create new titles on the fly
Technical Analysis : Feasible with Studio
Don’t forget, if you ever have a
question...
Thank you.
#TfFC
2020
PROFESSIONAL SERVICES
PPT. Introduction & Views - Documentation.pdf

PPT. Introduction & Views - Documentation.pdf

  • 1.
    TfFC Using Studio 1.Introduction & Views Julien Domken - Business Analyst Contents taken from LNA’s training. SERVICES 2019
  • 2.
    0. Welcome About thistraining - WIIFY ● Goal : ○ Show the potential ○ Give a general understanding >< Being exhaustive (and exhausting !) To make sure you have the tools you’ll need in your daily activities
  • 3.
    TfFC Using StudioAgenda 1. Introduction & views 2. Automation & Access Rights 3. Reports 4. Create a new app
  • 4.
    Introduction & Views 1.Introduction to Studio 2. Technical Concepts : Quick Refresher 3. Technical Concept : Views 4. Exercices
  • 5.
  • 6.
  • 7.
    Elevator Pitch :Studio ● With vs Without Studio ● Test, Phase & Send to Production with only a few clicks (Studio Module)
  • 9.
    A few wordson PM Introduction ● The “Quickstart” Methodology ● The “80/20” rule ● Educate your SPOC
  • 10.
    Odoo Studio : 3Pitfalls to avoid to make your project a success ● Reinventing the wheel ● Customization vs Development ● Not focusing on the added value & the Business Need
  • 11.
    I - Reinventingthe wheel Take a look at what exists… … More than 45 apps & 400 modules... … and no need to reinvent them ! Ex : Invoicing & Sales Order
  • 12.
    The ‘Big Bang’ The‘Creative’ I - Two approaches, Same problem
  • 13.
    II - Customizationvs Development “If a picture is worth a thousand words, sometimes a development is worth a thousand customizations !”
  • 14.
    Interface Change VSBusiness flow Standard Automation VS Complex Process Adapting VS Creating II - Customization vs Development
  • 15.
    III - Notfocusing on added-value ● Is the technical cost worth it ? ○ Cost : time, money, complexity ● Does it impact a lot of users ? ○ Role distribution ● Why? ○ Why? Why? Why?...
  • 16.
    III - Notfocusing on added-value ● Does it ease the onboarding ? ○ Not Replicating ● Does it impact the business ? ○ Think business not Odoo
  • 17.
    IV - Allin all... -> Studio and its technical limits -> The limit you should set yourself/your customer
  • 18.
  • 19.
    PostgreSQL DataBase server ORM (Object RelationalMapping) Odoo Server FrontEnd Odoo Web
  • 20.
    From a databaseto a UI My Contacts (res.partner data table) name country_id customer Brandon Freeman United States TRUE
  • 21.
    PostgreSQL DataBase server ORM (Object RelationalMapping) Odoo Server FrontEnd Odoo Web My Contacts (res.partner data table) name country_id customer Brandon Freeman United States TRUE Odoo Database Structure: From a database to a UI
  • 22.
    What is adatabase ? Comparison with the Excel file ● Sheets are models ● Columns are fields ● Rows are records id name city email base.res_partner_1 ASUSTeK Taipei asusteK@yourcompany.example.com base.res_partner_address_27 Arthur Gomez Taipei base.res_partner_address_12 James Miller Taipei base.res_partner_address_2 Joseph Walters Taipei joseph.walters@asustek.com
  • 23.
    What is adatabase ? Comparison with the Excel file ● Sheets are models ● Columns are fields ● Rows are records id name city email base.res_partner_1 ASUSTeK Taipei asusteK@yourcompany.example.com base.res_partner_address_27 Arthur Gomez Taipei base.res_partner_address_12 James Miller Taipei base.res_partner_address_2 Joseph Walters Taipei joseph.walters@asustek.com
  • 24.
    Models Each Odoo modelis a distinct translation of a business concept. E.g. : An invoice, a sale order line, a customer. But they can work together and have relationships through their fields
  • 25.
    Fields Fields are wherethe data is stored Eg : Name, Status, Price, Weight, … They have different types & features (e.g. : Date, Dropdown menu, …) NB : Do not forget the naming conventions (“_id” & “_ids”)
  • 26.
    Fields types Text (char)Selection (selection) Multi-line Text (text) HTML (html) Integer number (integer) File (binary) Decimal number (float) Many2One (many2one) Date (date) One2many (one2many) Date & time (datetime) Many2Many (many2many) Checkbox (boolean)
  • 27.
    Fields (types) +Widgets Text (char) + Copyclipboardchar Decimal number (float) + timefloat Binary + image Checkbox (boolean) + toogle_button
  • 28.
    Relational fields ● M2O-> Many records pointing towards another one. ● O2M -> Does not exist “per se”, reverse search (M2O) Many2One & One2Many
  • 29.
    Relational fields ● M2M: Many records pointing towards many records… And vice versa ! ● O2O : Does not exist in Odoo, use M2O instead Many2Many & One2One
  • 30.
    Stored and notstored ● Is this information recorded in the DB or not? → YES: Stored → NO: Not stored ● All newly created fields are stored except the computed / related fields → To store them
  • 31.
    ● What ifthe field is not stored? → It’s not searchable → No Group by possible (not available in the pivot view) → Not usable in record rules (to be developed during the Access Rights session) ● Why should I store an information? → Performance ⇒ If you have any doubt, you can always ask to a technically skilled colleague Stored and not stored
  • 32.
    Menu items ● Menusallow to navigate through the differents models
  • 33.
  • 34.
    Views ● Views arethe interface that allows us to see the data in different ways (a graph, a form, a calendar, …) ● Different view types exist and can be grouped in ‘families’ ● The language used to create those views is (mostly) XML ● They’re stored in the database (Debug -> Technical -> Views)
  • 35.
    Entity ● Some charactershave special meaning in XML ● If you need to use them outside their initial use in the XML syntax, it will generate an error. ● To avoid these errors, replace the initial character with an entity reference Entity reference Character Meaning &lt; < Less than &gt; > Greater than &amp; & Ampersand &apos; ‘ Apostrophe &quot; “ Quotation mark Basics of XML
  • 36.
    Basics of XML XML& Markup ● What does XML means? ● eXtensible Markup Language. → It’s a markup language just like HTML. ● Markup structure ○ All XML elements must have a closing tag. ○ XML tags are case sensitive ○ XML elements must be properly nested ○ XML can be commented
  • 37.
    Element ● What isan XML element? ● It’s everything from the element’s start tag to the element’s end tag. ● An element can contain: → Attributes → Text → Other elements → A mix of the above Basics of XML
  • 38.
    Attribute ● What isan XML attribute? ● XML elements can have attributes that qualify them. ● XML attribute values must be quoted Basics of XML
  • 39.
    Views How should youchoose ? ● Different usages ○ The Search view support all views and allow to filter/group/search ○ Gantt is for forecasting ○ Pivot, Graphs, … are for reporting purposes ○ Grid is either for mass creation or reporting
  • 40.
    Views How should youchoose ? ● Different usages ○ Form views are used to create / edit complex records ○ List views to either provide overviews, look for records or edit simple records ○ Kanban view are built to support flows
  • 41.
    General constraint : Aview is always based on a single model ● Contacts ● Opportunities ● Employees ● ... Except… ?
  • 42.
    Relational fields : Exampleof a view showing several models
  • 43.
    View inheritance andStudio ● Standard views and updates ● Creating Inherited views (xpaths) ● Studio
  • 44.
    View Inheritance ● Howan inherited view looks like? ○ A serie of change to be applied on the initial one. ● Main vs. Extension ○ A view can be modified by inherited view. ○ In our case, we’ll always build the inheritance by creating “Extension” views based on a Main one ● Sequence ○ Odoo applies changes in a view respecting the sequence. → The bigger the sequence is, the later your change occurs in the view ● Change localization (WHERE) ○ XPATH vs. element ○ Keep it as simple as possible ● Positions (WHAT) ○ Before ○ After ○ Inside
  • 45.
    Attributes How to makea view dynamic ● The same field cannot have different behaviors => Solution ? ● Clearer UI ● Enforce a process (! user frustration)
  • 46.
    Attributes A whole setof other tools ● Domains ● Default values ● Context ● Placeholders ● ...
  • 47.
    Attributes : Afew examples ● Sale orders ● Attachment ● Studio conditional attrs
  • 48.
    Odoo Studio GuidedTour ● Menus ● Views and options ● Fields and options (new and existing) => Explore
  • 49.
    Main Elements inOdoo ● field ○ Display a field and its label. ● label ○ Give a label to another element. ● group ○ Gather elements within the same part of the screen. 1 2 3 4 5
  • 50.
    Main Elements inOdoo ● button ○ Display a button. ● separator ○ Give a name to a section. ● notebook ○ Display a sub-section in the form view. ● page ○ Display a tab in a notebook.
  • 51.
  • 52.
    Industry 2 Business Need: PLZ Pick-up the Phone© is a company active in the telemarketing industry. The main app they will work with is the CRM. For reporting as well as micro-management purposes, they would like to keep track of every call made by their employees. The information they need are : WHO, WHEN, LENGTH OF THE CALL, STATUS, COMMENT The different STATUS are : Sold, Asked to call back, Fake number, Refused Of course, registering a new call should not erase the information from the previous one ! Functional Analysis : On the opportunity : ● Create a new model “call report” and link it to opportunities ● Add a data table in a new tab which users can record their calls (date, length, status, comment) line by line ● Users should be able to edit/create their reports on those lines ● A menu item should allow the managers to access all “reports” and to group/filter them Technical Analysis : Feasible with Studio
  • 53.
    Industry 3 Business Need: His&Her© is a fashion company that will heavily use the Mass Mailing module to promote their new catalogs. As such, they need to be sure of their customer gender (different campaigns). Moreover, they will heavily use titles in their email openings (ex : Miss, Mister, …) and would like to clearly distinguish those between genders (to avoid : Dear Miss John Smith). For them, the titles are ordered in three categories (male, female, not defined). Functional Analysis : On the contacts ● Allow users to select a gender ● Make sure users can only select a title that matches the gender of the contact ● Both field should be mandatory as otherwise users won’t fill them in ● Make sure users do not create new titles on the fly Technical Analysis : Feasible with Studio
  • 54.
    Don’t forget, ifyou ever have a question...
  • 55.