Deleting records from XML files
In the previous recipes, we saw how we can create or update records from the XML file. Sometimes, from the dependent module, you want to delete the previously created records. This can be done with the <delete>
tag.
Getting ready
In this recipe, we will add some categories from the XML file and then delete them. In real situations, you will create this record from another module. But for simplicity, we will just add some categories in the same XML file, as follows:
<record id="book_category_to_delete" model="library.book.category"> <field name="name">Test Category</field> </record> <record id="book_category_not_delete" model="library.book.category"> <field name="name">Test Category 2</field> </record>
How to do it...
There are two ways to delete records from the XML file:
- ...