How to delete record from xml files in odoo 13? – CBMS Odoo ERP

How to delete record from xml files in odoo 13? – CBMS Odoo ERP

How to delete record from xml files in odoo

As you may know, we can delete records from the UI ( using the delete button in the action in the record) or from the python function. Suppose you need to delete records from the database or install some custom modules, so in that case, you need to write some extra fields, and for the proper working of your module you may need to delete some records from the database. So that may be the case when you need to delete the records.

There are two ways to delete records from XML as follows:

1. Using the search Domain.
2. Using the XML ID of the previously created records.

1. Using the search domain

In this method, you need to pass the domain in the domain attribute. So during the installation of your custom modules odoo will try to find the records based on the domain that you have given. If records are found, odoo will delete those matching records. Compared to the previous method this method will not raise an error if no records are found matching the given domain. So while using this method you have to be more careful as it will delete your user’s data since the search option deletes all the records that match the domain.

2. Using the XML ID of the previously created records.

In this method, Odoo will find the record using the XML ID that you have given. So if there is any record corresponding to the given XML ID it will delete that record . And suppose it doesn’t find any matching record it will raise an error. You can only delete the records that are created from the XML files (or records that have the XML IDs).
For more information visit:

#odoodevelopment #odootutorial #odoo13
For More Videos Subscribe to our YouTube channel.

Visit our company website:

Connect with us:
Facebook:
twitter:
LinkedIn:
Pinterest:

About Us
Cybrosys is enriched with technical experts and research scholars producing high-end quality software tools. Our sophisticated infrastructure and lab facilities constantly bring in new technological innovations and attributions. Partnership with ODOO, MICROSOFT, IBM, Intel, HP, NASSCOM proves our strength and excellence.

We are Odoo Gold Partners standing par excellence in Odoo Implementation, Customization, and allied services. We do Source code sale, Custom software development, and Employee outsourcing. The latest research and developments in Cybrosys are being conducted in Blockchain. Our robust quality product and services are widely used by clients residing across in India, USA, UK, Middle East & Europe.

#delete #record #xml #files #odoo

Similar Posts

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *