Search Here

How to use copy function in Odoo

 In this article you will learn how and why we use copy function in Odoo. Sometime we need to create duplicate records with some new id (object id or Foreign Key). To achieve this we use copy function provided by Odoo.

How to use copy function in Odoo, Duplicate a specific record, Add default attribute in duplicate record, Modify default copy function, Odoo copy method

Benefit of using copy function in Odoo

By using copy function we don't need to create values of dictionary. For example a model has 30+ fields, and we want to create a new record using same records using python code. 

Read More: How to Duplicate Records using Copy and Copy Data Function in Odoo15

To do that we have to create values of dictionary that contains 30+ key value pairs. To avoid this we use copy function provided by Odoo.


  1. primary_key_id (id of the record for which you want to copy field value to create new record)
  2. .copy function will contains dictionary of key value pair for all the 30 fields
  3. some_field (If you want to change some record value than pass value here)

Post a Comment

0 Comments