SlideShare a Scribd company logo
1 of 13
name_search() Function in Odoo 16
● name_search() is an Odoo ORM method that is responsible for searching
some specific record by some field values in a relational field.
● In Odoo, the name search function is used to search records of a model in a
relational field with a partial value or with fields other than the record's
default name. For instance, when searching records in a Many2one field, by
default, when we type the record name, we can search and choose from the
records that are already there. However, we may use the name_search
function to search using various parameters.
Let’s see an example in Odoo.
When we create a record in that form with a customer field, we can search
existing records when we type the customer’s name. Also, when we type the
phone number of the contact, we can search that particular record.
In this example, the phone number of the contact.
Copy this phone number and search in customer field,
here you can see no customer is found but using name_search function you can do this.
If we search in the customer’s field using this phone number, we can
get a list of contacts with this phone number. Also, you can see that
we can search using a partial value of name or phone number.
This property is achieved using the name search function.
Let’s see how the name search function is defined.
The parameters of the function are:
name (str): The name pattern to match
args (list): Optional search domain to specify further restrictions
operator (str): domain operator for matching names,
such as 'like', ‘ilike’, ‘=’, etc.
limit (int): Optional to limit the maximum number of records to
be returned.
name_get_uid: To specify the user or to restrict users
Suppose we require that we also add an email address for searching
for customers. For that, we have to define a name search function in
"res.partner’ by inheriting the model.
By default, the value of args is given as None. We can provide the
conditions we need for the name search function as a domain and
append the args list inside the function.
Now we can search the contacts using the phone number.
Here is the result,
Check our company website
for related blogs and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
https://www.youtube.com/watch?v=ub4kLrTQVNk

More Related Content

What's hot

บทนำเกี่ยวกับจิตวิทยา Present
บทนำเกี่ยวกับจิตวิทยา Presentบทนำเกี่ยวกับจิตวิทยา Present
บทนำเกี่ยวกับจิตวิทยา Present
Kobchai Khamboonruang
 
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
bpatra
 

What's hot (15)

View Inheritance in Odoo 16
View Inheritance in Odoo 16View Inheritance in Odoo 16
View Inheritance in Odoo 16
 
Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기Go로 새 프로젝트 시작하기
Go로 새 프로젝트 시작하기
 
Катерина Сопова. Охорона слогана як обєкта права інтелектуальної власності
Катерина Сопова. Охорона слогана як обєкта права інтелектуальної власностіКатерина Сопова. Охорона слогана як обєкта права інтелектуальної власності
Катерина Сопова. Охорона слогана як обєкта права інтелектуальної власності
 
발표Ppt (1)
발표Ppt (1)발표Ppt (1)
발표Ppt (1)
 
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
 
สไลด์ประกอบการสัมมนา
สไลด์ประกอบการสัมมนาสไลด์ประกอบการสัมมนา
สไลด์ประกอบการสัมมนา
 
บทนำเกี่ยวกับจิตวิทยา Present
บทนำเกี่ยวกับจิตวิทยา Presentบทนำเกี่ยวกับจิตวิทยา Present
บทนำเกี่ยวกับจิตวิทยา Present
 
Atlassian을 이용한 애자일 ALM 소개 / JIRA 프로젝트 예산 관리 - 커브
Atlassian을 이용한 애자일 ALM 소개 / JIRA 프로젝트 예산 관리 - 커브Atlassian을 이용한 애자일 ALM 소개 / JIRA 프로젝트 예산 관리 - 커브
Atlassian을 이용한 애자일 ALM 소개 / JIRA 프로젝트 예산 관리 - 커브
 
ChatGPT: der unermüdliche Q&A-Tutor auf frag.jetzt
ChatGPT: der unermüdliche Q&A-Tutor auf frag.jetztChatGPT: der unermüdliche Q&A-Tutor auf frag.jetzt
ChatGPT: der unermüdliche Q&A-Tutor auf frag.jetzt
 
ReSharper Presentation for NUGs
ReSharper Presentation for NUGsReSharper Presentation for NUGs
ReSharper Presentation for NUGs
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
 
Rôles Alfresco
Rôles AlfrescoRôles Alfresco
Rôles Alfresco
 
Apache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed storeApache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed store
 
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
ขั้นตอนการเขียนโปรแกรมคอมพิวเตอร์
 
เรียงร้อยถ้อยคำลำนำสมุนไพร สิรินธร สุรินทร์
เรียงร้อยถ้อยคำลำนำสมุนไพร  สิรินธร สุรินทร์เรียงร้อยถ้อยคำลำนำสมุนไพร  สิรินธร สุรินทร์
เรียงร้อยถ้อยคำลำนำสมุนไพร สิรินธร สุรินทร์
 

Similar to Name Search() Function in Odoo 16

Similar to Name Search() Function in Odoo 16 (20)

How to create _name_search function in odoo 17
How to create _name_search function in odoo 17How to create _name_search function in odoo 17
How to create _name_search function in odoo 17
 
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
 
Difference Between Search and Browse in Odoo 16
Difference Between Search and Browse in Odoo 16Difference Between Search and Browse in Odoo 16
Difference Between Search and Browse in Odoo 16
 
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
 
Python functions
Python   functionsPython   functions
Python functions
 
Boolean operators
Boolean operatorsBoolean operators
Boolean operators
 
OSINT - Yandex Search
OSINT - Yandex SearchOSINT - Yandex Search
OSINT - Yandex Search
 
Remedy_Web_Searches_and_Reporting.pdf
Remedy_Web_Searches_and_Reporting.pdfRemedy_Web_Searches_and_Reporting.pdf
Remedy_Web_Searches_and_Reporting.pdf
 
Naming Standards, Clean Code
Naming Standards, Clean CodeNaming Standards, Clean Code
Naming Standards, Clean Code
 
Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15 Odoo ORM Methods | Object Relational Mapping in Odoo15
Odoo ORM Methods | Object Relational Mapping in Odoo15
 
What is Google search operators
What is Google search operatorsWhat is Google search operators
What is Google search operators
 
How to Define One2Many Field in Odoo 15
 How to Define One2Many Field in Odoo 15 How to Define One2Many Field in Odoo 15
How to Define One2Many Field in Odoo 15
 
Many2One Fields in Odoo 16
Many2One Fields in Odoo 16Many2One Fields in Odoo 16
Many2One Fields in Odoo 16
 
Boolean guidance
Boolean guidanceBoolean guidance
Boolean guidance
 
Boolean Guidance
Boolean GuidanceBoolean Guidance
Boolean Guidance
 
Sameer
SameerSameer
Sameer
 
AIResume Automated Generation Of Resume Work History
AIResume  Automated Generation Of Resume Work HistoryAIResume  Automated Generation Of Resume Work History
AIResume Automated Generation Of Resume Work History
 
Feature Engineering in NLP.pdf
Feature Engineering in NLP.pdfFeature Engineering in NLP.pdf
Feature Engineering in NLP.pdf
 
Python programming - Functions and list and tuples
Python programming - Functions and list and tuplesPython programming - Functions and list and tuples
Python programming - Functions and list and tuples
 
How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16How to Make Sequence Number in Odoo 16
How to Make Sequence Number in Odoo 16
 

More from Celine George

More from Celine George (20)

Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
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
 
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
 

Recently uploaded

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 

Recently uploaded (20)

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 

Name Search() Function in Odoo 16

  • 2. ● name_search() is an Odoo ORM method that is responsible for searching some specific record by some field values in a relational field. ● In Odoo, the name search function is used to search records of a model in a relational field with a partial value or with fields other than the record's default name. For instance, when searching records in a Many2one field, by default, when we type the record name, we can search and choose from the records that are already there. However, we may use the name_search function to search using various parameters.
  • 3. Let’s see an example in Odoo.
  • 4. When we create a record in that form with a customer field, we can search existing records when we type the customer’s name. Also, when we type the phone number of the contact, we can search that particular record. In this example, the phone number of the contact.
  • 5. Copy this phone number and search in customer field,
  • 6. here you can see no customer is found but using name_search function you can do this.
  • 7. If we search in the customer’s field using this phone number, we can get a list of contacts with this phone number. Also, you can see that we can search using a partial value of name or phone number. This property is achieved using the name search function. Let’s see how the name search function is defined.
  • 8.
  • 9. The parameters of the function are: name (str): The name pattern to match args (list): Optional search domain to specify further restrictions operator (str): domain operator for matching names, such as 'like', ‘ilike’, ‘=’, etc. limit (int): Optional to limit the maximum number of records to be returned. name_get_uid: To specify the user or to restrict users
  • 10. Suppose we require that we also add an email address for searching for customers. For that, we have to define a name search function in "res.partner’ by inheriting the model. By default, the value of args is given as None. We can provide the conditions we need for the name search function as a domain and append the args list inside the function.
  • 11. Now we can search the contacts using the phone number.
  • 12. Here is the result,
  • 13. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. https://www.youtube.com/watch?v=ub4kLrTQVNk