SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
How to use name_create method in Odoo
18
Enterprise
Enterprise
Introduction
In this slide, we’ll discuss on how to use name_create method in
Odoo 18. The name_create method in Odoo is a powerful utility
for creating records dynamically while ensuring they are
identified by their display name. This method is particularly
useful in scenarios where a user needs to quickly add a new
record directly from a Many2one field dropdown or other related
fields. It enables the creation of a record by simply providing a
name, reducing the need for switching between views or
modules.
Enterprise
The name_create method is called when creating a record from
many2one field directly by name. We have two options to create
the record from here either by clicking on create or create and edit.
Enterprise
When we click on the Create option, we can see the name_create
method will be called directly. For that we have overridden the
following methods in our custom module and added the print
statements.
def create(self, vals):
print("Main create method")
res = super().create(vals)
print(res, "res in create method")
return res
@api.model
def name_create(self, name):
print("Name create method")
res = super().name_create(name)
print(res, "res in name_create method")
return res
Enterprise
Upon clicking on the create option from Many2one field, first we
can see name_create method will be called first and then the create
method. Also we can see name_create method only returns the
tuple. But If we click on the Create and edit option, we can see only
create method is called and it will return recordset. Another thing is
if we don't want to call the super method in the name_create
method and we want to return in our way, we can use the following
method for name_create().
@api.model
def name_create(self, name):
res = self.create({'name': name})
return res.id, res.display_name
For More Info.
Check our company website for related blogs
and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

More Related Content

PDF
Connecting your Python App to OpenERP through OOOP
PDF
Connecting your Python App to OpenERP through OOOP
PPTX
How to Empty a One2Many Field in Odoo 17
PPTX
How to Empty a One2Many Field in Odoo 17
PPTX
Model Attribute _rec_name in the Odoo 17
PPTX
Model Attribute _rec_name in the Odoo 17
PPTX
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
PPTX
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Connecting your Python App to OpenERP through OOOP
Connecting your Python App to OpenERP through OOOP
How to Empty a One2Many Field in Odoo 17
How to Empty a One2Many Field in Odoo 17
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18

Similar to How to use name_create method in Odoo 18 (20)

PPTX
How to Configure Field Cleaning Rules in Odoo 17
PPTX
How to Configure Field Cleaning Rules in Odoo 17
DOC
Cis407 a ilab 4 web application development devry university
DOC
Cis407 a ilab 4 web application development devry university
PPTX
How to Empty a Many2Many Field in Odoo 17
PPTX
How to Empty a Many2Many Field in Odoo 17
DOCX
Cis 407 i lab 6 of 7
DOCX
Cis 407 i lab 6 of 7
PDF
Diving into VS 2015 Day5
PDF
Diving into VS 2015 Day5
PPTX
How to Create and Manage Wizard in Odoo 17
PPTX
How to Create and Manage Wizard in Odoo 17
PDF
Diving into VS 2015 Day3
PDF
Diving into VS 2015 Day3
DOC
Cis407 a ilab 6 web application development devry university
DOC
Cis407 a ilab 6 web application development devry university
DOCX
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
DOCX
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
PPTX
How to Super Create Write Functions in Odoo 17
PPTX
How to Super Create Write Functions in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17
How to Configure Field Cleaning Rules in Odoo 17
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry university
How to Empty a Many2Many Field in Odoo 17
How to Empty a Many2Many Field in Odoo 17
Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7
Diving into VS 2015 Day5
Diving into VS 2015 Day5
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
Diving into VS 2015 Day3
Diving into VS 2015 Day3
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
How to Super Create Write Functions in Odoo 17
How to Super Create Write Functions in Odoo 17
Ad

More from Celine George (20)

PPTX
How to Implement OWL Notification Service in Odoo 18
PPTX
Tracking Profit Margins in Sales Orders with Odoo 18
PPTX
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
PPTX
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
PPTX
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
PPTX
How to Add New Applicants in Odoo 18 Recruitment
PPTX
How to Analyze the Recruitment Process in Odoo 18 Recruitment
PPTX
How to Manage Referral Reporting in Odoo 18 Referrals
PPTX
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PPTX
How to Manage Bill Control Policy in Odoo 18
PPTX
How to Manage Loyalty Points in Odoo 18 Sales
PPTX
Odoo 18 Sales_ Managing Quotation Validity
PPTX
How to Manage Global Discount in Odoo 18 POS
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
How to Implement OWL Notification Service in Odoo 18
Tracking Profit Margins in Sales Orders with Odoo 18
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
How to Add New Applicants in Odoo 18 Recruitment
How to Analyze the Recruitment Process in Odoo 18 Recruitment
How to Manage Referral Reporting in Odoo 18 Referrals
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Revamp in MTO Odoo 18 Inventory - Odoo Slides
How to Manage Starshipit in Odoo 18 - Odoo Slides
How to Manage Bill Control Policy in Odoo 18
How to Manage Loyalty Points in Odoo 18 Sales
Odoo 18 Sales_ Managing Quotation Validity
How to Manage Global Discount in Odoo 18 POS
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Tips Management in Odoo 18 POS - Odoo Slides
How to Close Subscription in Odoo 18 - Odoo Slides
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
How to Track Skills & Contracts Using Odoo 18 Employee
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Trump Administration's workforce development strategy
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
master seminar digital applications in india
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
Abdominal Access Techniques with Prof. Dr. R K Mishra
Module 4: Burden of Disease Tutorial Slides S2 2025
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial diseases, their pathogenesis and prophylaxis
Weekly quiz Compilation Jan -July 25.pdf
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Trump Administration's workforce development strategy
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

How to use name_create method in Odoo 18

  • 1. How to use name_create method in Odoo 18 Enterprise
  • 2. Enterprise Introduction In this slide, we’ll discuss on how to use name_create method in Odoo 18. The name_create method in Odoo is a powerful utility for creating records dynamically while ensuring they are identified by their display name. This method is particularly useful in scenarios where a user needs to quickly add a new record directly from a Many2one field dropdown or other related fields. It enables the creation of a record by simply providing a name, reducing the need for switching between views or modules.
  • 3. Enterprise The name_create method is called when creating a record from many2one field directly by name. We have two options to create the record from here either by clicking on create or create and edit.
  • 4. Enterprise When we click on the Create option, we can see the name_create method will be called directly. For that we have overridden the following methods in our custom module and added the print statements. def create(self, vals): print("Main create method") res = super().create(vals) print(res, "res in create method") return res @api.model def name_create(self, name): print("Name create method") res = super().name_create(name) print(res, "res in name_create method") return res
  • 5. Enterprise Upon clicking on the create option from Many2one field, first we can see name_create method will be called first and then the create method. Also we can see name_create method only returns the tuple. But If we click on the Create and edit option, we can see only create method is called and it will return recordset. Another thing is if we don't want to call the super method in the name_create method and we want to return in our way, we can use the following method for name_create(). @api.model def name_create(self, name): res = self.create({'name': name}) return res.id, res.display_name
  • 6. For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com