Deleting records from XML files
We learned how to generate or change records from the XML file in the previous tutorials. You may occasionally wish to remove the records that have already been created from the dependent module. The <delete>
tag can be used.
Getting ready
In this tutorial, 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 to the same XML file, as follows:
<record id="room_category_to_remove" model="hostel.room.category"> <field name="name">Single sharing</field> </record> <record id="room_category_not_remove" model="hostel.room.category"> <field name="name">Double Sharing</field> </record>
How to do it...
There are two ways to remove records from the XML file...