SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Odoo ORM
Methods
www.cybrosys.com
INTRODUCTION
❖ ORM(Object Relational Mapping) is a concept or technique which acts as a bridge
between your programming language and your database.
❖ The Object Relational Mapping helps to execute SQL queries without writing them
explicitly.
❖ Once the ORM is configured in an application, the user can use the OOP concepts like
classes and objects to interact with the database.
❖ ORM methods are one of its strong features which helps in executing SQL queries
without writing them down explicitly. With the help of ORM methods, the user can
implement the OOPS concepts to interact with the database.
❖ Odoo creates and manages tables for us inside the database. Thus reducing our work of
creation of tables using the queries.
❖ sorted ( )
○ The sorted() method returns the records inside the self, ordered by the key
passed as the argument.
○ Syntax: Model.sorted(key=None, reverse=False), If reverse is set as True, returns
the result in reverse order.
○ Eg: records.sorted(key=lambda r: r.name) - Sorts the record based on the name
field.
❖ mapped ( )
○ The mapped() function applies the function given as an argument on all the
records in the self, and then returns the result as a list or recordset. This method
accepts a function as its argument.
○ Syntax: Model.mapped(func) ? recordset / list
○ Eg: records.mapped(lambda r: r.field1 + r.field2) - This returns a list of summing two
fields for each record in the set.
❖ filtered ( )
○ The filtered method returns a set of records which satisfies the function given as
argument. This method accepts a function as its argument.
○ Syntax: Model.filtered(func) ? records
○ Eg: records.filtered(lambda r: r.company_id == user.company_id) - This only
keeps records whose company is the current user's.
For More
Details
Check our company website for related blogs and Odoo book.
Common ORM Methods
ORM (Object Relational Mapping) in Odoo
Check our YouTube channel for functional and technical
videos in Odoo.
Odoo ORM Methods
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

View Inheritance in Odoo 15
View Inheritance in Odoo 15View Inheritance in Odoo 15
View Inheritance in Odoo 15
 
Oracle report from ppt
Oracle report from pptOracle report from ppt
Oracle report from ppt
 
Model Fields in Odoo 15
 Model Fields in Odoo 15 Model Fields in Odoo 15
Model Fields in Odoo 15
 
Object Relation Mapping in Odoo 16
Object Relation Mapping in Odoo 16Object Relation Mapping in Odoo 16
Object Relation Mapping in Odoo 16
 
Oracle Forms- key triggers
Oracle Forms- key triggersOracle Forms- key triggers
Oracle Forms- key triggers
 
What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...
What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...
What are Wizards - Defining and Launching in Odoo 15Wizards - Defining and La...
 
Oracle Forms Introduction
Oracle Forms IntroductionOracle Forms Introduction
Oracle Forms Introduction
 
Tips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptxTips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptx
 
Check printing in_r12
Check printing in_r12Check printing in_r12
Check printing in_r12
 
Odoo - From v7 to v8: the new api
Odoo - From v7 to v8: the new apiOdoo - From v7 to v8: the new api
Odoo - From v7 to v8: the new api
 
Oracle Forms Tutorial
Oracle Forms TutorialOracle Forms Tutorial
Oracle Forms Tutorial
 
Lot or Serial Number Configuration in Odoo 15
Lot or Serial Number Configuration in Odoo 15Lot or Serial Number Configuration in Odoo 15
Lot or Serial Number Configuration in Odoo 15
 
HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/
 
Oracle Concurrent Program Setup document
Oracle Concurrent Program Setup  documentOracle Concurrent Program Setup  document
Oracle Concurrent Program Setup document
 
Oracle Apps - Forms
Oracle Apps - FormsOracle Apps - Forms
Oracle Apps - Forms
 
Basic Views in Odoo 16
Basic Views in Odoo 16Basic Views in Odoo 16
Basic Views in Odoo 16
 
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
 
Odoo External API
Odoo External APIOdoo External API
Odoo External API
 
HR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.infoHR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.info
 
Customizing Oracle EBS OA Framework
Customizing Oracle EBS OA FrameworkCustomizing Oracle EBS OA Framework
Customizing Oracle EBS OA Framework
 

Ähnlich wie Odoo ORM Methods | Object Relational Mapping in Odoo15

Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
Avelin Huo
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
Jabs6
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
Muhammad Jahanzaib
 

Ähnlich wie Odoo ORM Methods | Object Relational Mapping in Odoo15 (20)

ORDBMS.pptx
ORDBMS.pptxORDBMS.pptx
ORDBMS.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
 
04 pig data operations
04 pig data operations04 pig data operations
04 pig data operations
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
 
Similarity computation exploiting the semantic and syntactic inherent structu...
Similarity computation exploiting the semantic and syntactic inherent structu...Similarity computation exploiting the semantic and syntactic inherent structu...
Similarity computation exploiting the semantic and syntactic inherent structu...
 
Search Engine-Building with Lucene and Solr, Part 1 (SoCal Code Camp LA 2013)
Search Engine-Building with Lucene and Solr, Part 1 (SoCal Code Camp LA 2013)Search Engine-Building with Lucene and Solr, Part 1 (SoCal Code Camp LA 2013)
Search Engine-Building with Lucene and Solr, Part 1 (SoCal Code Camp LA 2013)
 
Query Optimization - Brandon Latronica
Query Optimization - Brandon LatronicaQuery Optimization - Brandon Latronica
Query Optimization - Brandon Latronica
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
 
Adv DB - Full Handout.pdf
Adv DB - Full Handout.pdfAdv DB - Full Handout.pdf
Adv DB - Full Handout.pdf
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Large-scale Reasoning with a Complex Cultural Heritage Ontology (CIDOC CRM) ...
 Large-scale Reasoning with a Complex Cultural Heritage Ontology (CIDOC CRM) ... Large-scale Reasoning with a Complex Cultural Heritage Ontology (CIDOC CRM) ...
Large-scale Reasoning with a Complex Cultural Heritage Ontology (CIDOC CRM) ...
 
Jarrar: ORM in Description Logic
Jarrar: ORM in Description Logic  Jarrar: ORM in Description Logic
Jarrar: ORM in Description Logic
 

Mehr von Celine George

Mehr von Celine George (20)

How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Make Down Payments in Odoo 17 Sales App
How to Make Down Payments in Odoo 17 Sales AppHow to Make Down Payments in Odoo 17 Sales App
How to Make Down Payments in Odoo 17 Sales App
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Odoo ORM Methods | Object Relational Mapping in Odoo15

  • 2. INTRODUCTION ❖ ORM(Object Relational Mapping) is a concept or technique which acts as a bridge between your programming language and your database. ❖ The Object Relational Mapping helps to execute SQL queries without writing them explicitly. ❖ Once the ORM is configured in an application, the user can use the OOP concepts like classes and objects to interact with the database. ❖ ORM methods are one of its strong features which helps in executing SQL queries without writing them down explicitly. With the help of ORM methods, the user can implement the OOPS concepts to interact with the database. ❖ Odoo creates and manages tables for us inside the database. Thus reducing our work of creation of tables using the queries.
  • 3. ❖ sorted ( ) ○ The sorted() method returns the records inside the self, ordered by the key passed as the argument. ○ Syntax: Model.sorted(key=None, reverse=False), If reverse is set as True, returns the result in reverse order. ○ Eg: records.sorted(key=lambda r: r.name) - Sorts the record based on the name field.
  • 4. ❖ mapped ( ) ○ The mapped() function applies the function given as an argument on all the records in the self, and then returns the result as a list or recordset. This method accepts a function as its argument. ○ Syntax: Model.mapped(func) ? recordset / list ○ Eg: records.mapped(lambda r: r.field1 + r.field2) - This returns a list of summing two fields for each record in the set.
  • 5. ❖ filtered ( ) ○ The filtered method returns a set of records which satisfies the function given as argument. This method accepts a function as its argument. ○ Syntax: Model.filtered(func) ? records ○ Eg: records.filtered(lambda r: r.company_id == user.company_id) - This only keeps records whose company is the current user's.
  • 6. For More Details Check our company website for related blogs and Odoo book. Common ORM Methods ORM (Object Relational Mapping) in Odoo Check our YouTube channel for functional and technical videos in Odoo. Odoo ORM Methods
  • 7.