ORM Methods in Odoo 16
1. create():
Model.create(vals_list)
This method is used to create a new record in the database.
Best ERP Blog
2. copy()
:
Model.copy
The copy method creates a new record that is an exact duplicate of the original record.
Best ERP Blog
3. flush():Model.flush
The flush method is used to handle pending calculations and updates on records in a model.
Best ERP Blog
4. Search():
This method is used to search for records based on specified criteria. It returns a list of record ids matching the search criteria.
Best ERP Blog
5. Browse():
This method is used to retrieve records from the database based on their IDs.
Best ERP Blog
6. Read():
This method is used to retrieve the field values of one or more records. It takes a list of record IDs and a list of field names to read.
Best ERP Blog
7. Write():
This method is used to update the field values of one or more records. It takes a dictionary of field-value pairs to update.
Best ERP Blog
8. Unlink():
This method is used to delete one or more records from the database.
Best ERP Blog
9. Sort :
Model.sorted(key=None, reverse=False) Returns a self-ordered Recordset with the key.
Best ERP Blog