SlideShare a Scribd company logo
Odoo
Mastering Odoo 11.0 Development
Mohamed Magdy
OpenObject Concepts
● OOP Class is Object.
● OOP Instance is Resource.
● There is an object for every type of resource,
and not an object per resource.
● MVC:
○ Model: PostgreSQL tables.
○ View: Defined in XML files.
○ Controller: Odoo Objects.
Module Structure
module_name
● __init__.py
● __manifest__.py
● module_name.py
● views/
● security/
● demo/
● wizard/
● report/
● i18n/
● static/
Objects
● In Odoo, Objects are Classes define new
types.
● Models
○ Add new Tables, Fields in Database.
○ Add SQL Constraints.
● Controllers
○ Methods to compute Values.
○ Onchange Methods.
○ Methods (Logic) behind Buttons.
Fields Types (MorePython.com)
● Boolean: is_new_field = fields.Boolean(string="", )
● Char: new_field = fields.Char(string="", required=False, )
● Text: new_field = fields.Text(string="", required=False, )
● Integer: new_field = fields.Integer(string="", required=False, )
● Float: new_field = fields.Float(string="", required=False, )
● Date: new_field = fields.Date(string="", required=False, )
● Datetime: new_field = fields.Datetime(string="", required=False, )
● Selection: new_field = fields.Selection(string="", selection=[('', ''), ('', ''), ], required=False, )
● Many2many: new_field_ids = fields.Many2many(comodel_name="", relation="", column1="", column2="", string="", )
● One2many: new_field_ids = fields.One2many(comodel_name="", inverse_name="", string="", required=False, )
● Many2one: new_field_id = fields.Many2one(comodel_name="", string="", required=False, )
● Binary: new_field = fields.Binary(string="", )
Common Attributes (MorePython.com)
Some attributes are common:
● string: The label of the field seen by users.
● help: The tooltip of the field seen by users.
● readonly: Determines if the field is read-only or editable (boolean).
● required: Determines if the field is required or optional (boolean).
● index: Determines if the field is indexed inDB (boolean).
● default: The default value of the field, it can be static or computed value.
● states: A dictionary mapping state values to lists of UI attribute-value.
● groups: Comma-separated lists of group XML ids.
● copy: Whether to copy the field value when the record is duplicated or not.
● old_name: The old name of this field, so that ORM rename at migration.
● compute: The name of the method that computes the field’s value.
Common Attributes (MorePython.com)
Some attributes are common:
● inverse: The name of a method that inverses the field.
● search: The name of a method that implement search on the field.
● store: Determines if the field is stored in DB (boolean).
● compute_sudo: Determines if the field should be recomputed as superuser
to bypass access rights (boolean).
● related: To get the field’s value automatically from the source field.
● company_dependant: If the field is company-dependant (boolean).
Specific Attributes (MorePython.com)
Some attributes are for specific fields:
Char:
● size: The maximum size of the values stored for that field.
● translate: Enables the translation of the field’s value.
Text:
● translate: Enables the translation of the field’s value.
Float:
● digits: A pair (total, decimal), or a function taking a database cursor and
returning a pair (total, decimal)
Specific Attributes (MorePython.com)
Some attributes are for specific fields:
Selection:
● selection: Specifies the possible values for this field.
● add_selection: Provides an extension of the selection in the case of an
overridden field.
Monetary:
● currency_field: Name of the field holding the currency this monetary field
is expressed in.
Specific Attributes (MorePython.com)
Some attributes are for specific fields:
Many2one:
● comodel_name: Name of the target model (string).
● domain: An optional domain to set on candidate values on the client side.
● context: An optional context to use on the client side when handling that
field (dictionary).
● ondelete: Determines what to do when the referred record is deleted.
Possible values: set null, restrict or cascade.
● auto_join: Determines if JOINS are generated upon search through that
field (boolean).
● delegate: Set it to ‘True’ to make fields of the target model accessible from
the current model.
Specific Attributes (MorePython.com)
Some attributes are for specific fields:
One2many:
● comodel_name: Name of the target model (string).
● domain: An optional domain to set on candidate values on the client side.
● context: An optional context to use on the client side when handling that
field (dictionary).
● inverse_name: Name of the inverse ‘Many2one’ field in ‘comodel_name’.
● auto_join: Determines if JOINS are generated upon search through that
field (boolean).
● limit: Optional limit to use upon read (integer).
Some attributes are for specific fields:
Many2many:
● comodel_name: Name of the target model (string).
● relation: Optional limit to use upon read (integer).
● domain: An optional domain to set on candidate values on the client side.
● context: An optional context to use on the client side when handling that
field (dictionary).
● column1: An optional name of the column referring to ‘these’ records in
the table ‘relation’.
● column2: An optional name of the column referring to ‘those’ records in
the table ‘relation’.
● limit: Optional limit to use upon read (integer).
Specific Attributes (MorePython.com)
Odoo
Mastering Odoo 11.0 Development
Mohamed Magdy

More Related Content

PPTX
odoo 11.0 development (CRUD)
PDF
Data recovery using pg_filedump
PPT
MongoDB
PPTX
Html cors
PDF
pg_filedump
PDF
Beautiful soup
PDF
RedisConf17 - Redis as a JSON document store
PPTX
Redis Developers Day 2015 - Secondary Indexes and State of Lua
odoo 11.0 development (CRUD)
Data recovery using pg_filedump
MongoDB
Html cors
pg_filedump
Beautiful soup
RedisConf17 - Redis as a JSON document store
Redis Developers Day 2015 - Secondary Indexes and State of Lua

What's hot (20)

PPTX
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
PDF
What's new in Redis v3.2
PPTX
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
PDF
「DDD 完全に理解した」の次
PDF
Compiling EdgeQL
PDF
Use Redis in Odd and Unusual Ways
PPT
Hive Object Model
PPT
2011 mongo FR - scaling with mongodb
PDF
Adaptive Query Processing on RAW Data
PPTX
Thinking in Sequences - Streams in Node.js & IO.js
PPTX
Java file
PDF
Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...
PDF
JavaScript client API for Google Apps Script API primer
PDF
NoSQL Injections in Node.js - The case of MongoDB
PPTX
PPT
Java 7
PPT
2011 Mongo FR - MongoDB introduction
PDF
Superficial mongo db
PDF
SequoiaDB Distributed Relational Database
PPSX
CodeIgniter L5 email & user agent & security
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
What's new in Redis v3.2
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
「DDD 完全に理解した」の次
Compiling EdgeQL
Use Redis in Odd and Unusual Ways
Hive Object Model
2011 mongo FR - scaling with mongodb
Adaptive Query Processing on RAW Data
Thinking in Sequences - Streams in Node.js & IO.js
Java file
Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...
JavaScript client API for Google Apps Script API primer
NoSQL Injections in Node.js - The case of MongoDB
Java 7
2011 Mongo FR - MongoDB introduction
Superficial mongo db
SequoiaDB Distributed Relational Database
CodeIgniter L5 email & user agent & security
Ad

Similar to Odoo Technical Concepts Summary (20)

PPTX
An in Depth Journey into Odoo's ORM
PDF
Sorry - How Bieber broke Google Cloud at Spotify
PDF
Nzitf Velociraptor Workshop
PDF
Meetup C++ A brief overview of c++17
PPSX
Writing code that writes code - Nguyen Luong
PPSX
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
PDF
Scala laboratory: Globus. iteration #2
PDF
MongoDB- Crud Operation
PDF
PDF
Solr workshop
PDF
Data Science decoded- author: Rohit Dubey
PPTX
Oracle to Postgres Schema Migration Hustle
 
PDF
Enforcing API Design Rules for High Quality Code Generation
PPTX
Productionalizing ML : Real Experience
PPTX
Introduction To MongoDB
PDF
Custom Pregel Algorithms in ArangoDB
PDF
Mongodb Introduction
ODP
GDG Madrid - Dart Event - By Iván Zaera
PDF
Load testing in Zonky with Gatling
PDF
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
An in Depth Journey into Odoo's ORM
Sorry - How Bieber broke Google Cloud at Spotify
Nzitf Velociraptor Workshop
Meetup C++ A brief overview of c++17
Writing code that writes code - Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
Scala laboratory: Globus. iteration #2
MongoDB- Crud Operation
Solr workshop
Data Science decoded- author: Rohit Dubey
Oracle to Postgres Schema Migration Hustle
 
Enforcing API Design Rules for High Quality Code Generation
Productionalizing ML : Real Experience
Introduction To MongoDB
Custom Pregel Algorithms in ArangoDB
Mongodb Introduction
GDG Madrid - Dart Event - By Iván Zaera
Load testing in Zonky with Gatling
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
Ad

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
assetexplorer- product-overview - presentation
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Introduction to Artificial Intelligence
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Transform Your Business with a Software ERP System
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
history of c programming in notes for students .pptx
Why Generative AI is the Future of Content, Code & Creativity?
Odoo POS Development Services by CandidRoot Solutions
assetexplorer- product-overview - presentation
Softaken Excel to vCard Converter Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction to Artificial Intelligence
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Navsoft: AI-Powered Business Solutions & Custom Software Development
Digital Systems & Binary Numbers (comprehensive )
Operating system designcfffgfgggggggvggggggggg
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Transform Your Business with a Software ERP System
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
wealthsignaloriginal-com-DS-text-... (1).pdf
Understanding Forklifts - TECH EHS Solution
Odoo Companies in India – Driving Business Transformation.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx

Odoo Technical Concepts Summary

  • 1. Odoo Mastering Odoo 11.0 Development Mohamed Magdy
  • 2. OpenObject Concepts ● OOP Class is Object. ● OOP Instance is Resource. ● There is an object for every type of resource, and not an object per resource. ● MVC: ○ Model: PostgreSQL tables. ○ View: Defined in XML files. ○ Controller: Odoo Objects.
  • 3. Module Structure module_name ● __init__.py ● __manifest__.py ● module_name.py ● views/ ● security/ ● demo/ ● wizard/ ● report/ ● i18n/ ● static/
  • 4. Objects ● In Odoo, Objects are Classes define new types. ● Models ○ Add new Tables, Fields in Database. ○ Add SQL Constraints. ● Controllers ○ Methods to compute Values. ○ Onchange Methods. ○ Methods (Logic) behind Buttons.
  • 5. Fields Types (MorePython.com) ● Boolean: is_new_field = fields.Boolean(string="", ) ● Char: new_field = fields.Char(string="", required=False, ) ● Text: new_field = fields.Text(string="", required=False, ) ● Integer: new_field = fields.Integer(string="", required=False, ) ● Float: new_field = fields.Float(string="", required=False, ) ● Date: new_field = fields.Date(string="", required=False, ) ● Datetime: new_field = fields.Datetime(string="", required=False, ) ● Selection: new_field = fields.Selection(string="", selection=[('', ''), ('', ''), ], required=False, ) ● Many2many: new_field_ids = fields.Many2many(comodel_name="", relation="", column1="", column2="", string="", ) ● One2many: new_field_ids = fields.One2many(comodel_name="", inverse_name="", string="", required=False, ) ● Many2one: new_field_id = fields.Many2one(comodel_name="", string="", required=False, ) ● Binary: new_field = fields.Binary(string="", )
  • 6. Common Attributes (MorePython.com) Some attributes are common: ● string: The label of the field seen by users. ● help: The tooltip of the field seen by users. ● readonly: Determines if the field is read-only or editable (boolean). ● required: Determines if the field is required or optional (boolean). ● index: Determines if the field is indexed inDB (boolean). ● default: The default value of the field, it can be static or computed value. ● states: A dictionary mapping state values to lists of UI attribute-value. ● groups: Comma-separated lists of group XML ids. ● copy: Whether to copy the field value when the record is duplicated or not. ● old_name: The old name of this field, so that ORM rename at migration. ● compute: The name of the method that computes the field’s value.
  • 7. Common Attributes (MorePython.com) Some attributes are common: ● inverse: The name of a method that inverses the field. ● search: The name of a method that implement search on the field. ● store: Determines if the field is stored in DB (boolean). ● compute_sudo: Determines if the field should be recomputed as superuser to bypass access rights (boolean). ● related: To get the field’s value automatically from the source field. ● company_dependant: If the field is company-dependant (boolean).
  • 8. Specific Attributes (MorePython.com) Some attributes are for specific fields: Char: ● size: The maximum size of the values stored for that field. ● translate: Enables the translation of the field’s value. Text: ● translate: Enables the translation of the field’s value. Float: ● digits: A pair (total, decimal), or a function taking a database cursor and returning a pair (total, decimal)
  • 9. Specific Attributes (MorePython.com) Some attributes are for specific fields: Selection: ● selection: Specifies the possible values for this field. ● add_selection: Provides an extension of the selection in the case of an overridden field. Monetary: ● currency_field: Name of the field holding the currency this monetary field is expressed in.
  • 10. Specific Attributes (MorePython.com) Some attributes are for specific fields: Many2one: ● comodel_name: Name of the target model (string). ● domain: An optional domain to set on candidate values on the client side. ● context: An optional context to use on the client side when handling that field (dictionary). ● ondelete: Determines what to do when the referred record is deleted. Possible values: set null, restrict or cascade. ● auto_join: Determines if JOINS are generated upon search through that field (boolean). ● delegate: Set it to ‘True’ to make fields of the target model accessible from the current model.
  • 11. Specific Attributes (MorePython.com) Some attributes are for specific fields: One2many: ● comodel_name: Name of the target model (string). ● domain: An optional domain to set on candidate values on the client side. ● context: An optional context to use on the client side when handling that field (dictionary). ● inverse_name: Name of the inverse ‘Many2one’ field in ‘comodel_name’. ● auto_join: Determines if JOINS are generated upon search through that field (boolean). ● limit: Optional limit to use upon read (integer).
  • 12. Some attributes are for specific fields: Many2many: ● comodel_name: Name of the target model (string). ● relation: Optional limit to use upon read (integer). ● domain: An optional domain to set on candidate values on the client side. ● context: An optional context to use on the client side when handling that field (dictionary). ● column1: An optional name of the column referring to ‘these’ records in the table ‘relation’. ● column2: An optional name of the column referring to ‘those’ records in the table ‘relation’. ● limit: Optional limit to use upon read (integer). Specific Attributes (MorePython.com)
  • 13. Odoo Mastering Odoo 11.0 Development Mohamed Magdy