There's moreā€¦

If the model defined some default values for some fields, nothing special needs to be done; create() will take care of computing the default values for the fields that aren't present in the supplied dictionary.

From Odoo version 12, the create() method also supports the creation of records in a batch. To create multiple records in a batch, you need to pass a list of multiple values to the create() method, as shown in the following example:

categ1 = {
'name': 'Category 1',
'description': 'Description for Category 1'
}
categ2 = {
'name': 'Category 2',
'description': 'Description for Category 2'
}
multiple_records = self.env['library.book.category'].create([categ1, categ2])
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset