OpenERP Module Recording : A Complete How-to for XML/YML!

Did you ever come across a need during OpenERP development where you had to record a bunch of xml data or yml records at once and you don't like doing xml programming? Yes, this has been happening to many OpenERP developers who want to develop modules quickly and do not like demo/data records creation by the means of xml each time for their modules.

Relax then, the answer is here! Its base_module_record module which does this for you. Sadly, this module is no more available in version 7.0.

If you have gone through OpenERP Technical training, you might know this module better. If you still don't know, keep reading. Keep reading evn if you know well.

Talking about this module, it allows you to create a new module without any development. It records all operations on objects during the recording session and produces a .ZIP module. So you can create your own module directly from the OpenERP client. It works for creating and updating existing records. It recomputes dependencies and links for all types of widgets (many2one, many2many, ...). It also supports workflows and demo/update data.

This should help you to easily create reusable and publishable modules for custom configurations and demo/testing data.
How to use it: Here you go!!!!
Download the module : https://code.launchpad.net/~serpentcs/server-env-tools/base_module_record
For version 7, download the document from here :
Download
For version 6.1, see the information as follows:

Step 1 : First we will install the “base_record_module” from the addons

Click on Settings – Modules – Modules

Search the module name in the Name Field in the search view of modules:

After searching by name you will get the icon and after clicking on “Install” button you can install this module.

Step 3 : Do some creation or modification of records of some models from your system, these will turn into xml records. If you want to record your data as a Module with “data.xml” file and “__init__.py”, “__openerp__.py” files. then click on the “Export Customizations as a Module”

it will look like :

Date : That is from which date we want to record the data.

Record only : For only created records or/and modified record.

Objects : It will ask about the objects from which object we want to record the data.

YAML : If you select this check box then it convert your recorded data in to the YML file and if you don't select this then data will be in the XML format.

After Clicking the “Record” Button you will see a nice window showing confirmation, module naming, etc. which will eventually be used for your __openerp__.py.

So fill up this informatoin and click on “Continue”

This means your OpenERP module has been recorded and it will ask for .ZIP file to save.

And You can save the module as a ZIP file in your system.

Step 4 : Now if you want to record your data in YML or XML.

Click on “Export Customizations as Data” and you will see a nice window like below ( actually its wizard ).

As show above it will ask for the

Date : That is from which date we want to record the data.

Record only : for only created records or/and modified record.

Objects : It will ask about the objects from which object we want to record the data.

YAML : If you select this check box then it convert your recorded data in to the YML file and if you don't select this then data will be in the XML format.

In our case, tick this box.

Lets see the results now!!!

After clicking “Record” button it will display YML or XML formated data as per the our selection

(When not selecting the YAML Option)

(When selecting the YAML Option)

This is it!

Hope you have learnt another important module and this will help you develop you OpenERP modules faster.

If you want to get trained by our expert trainers, do contact us on contact@www.serpentcs.com.

CONNECT WITH US

SERPENTCS

OUR PARTNERS

SERPENTCS- ABOUT US

Serpent Consulting Services was founded back in
December 2011 with a vision of Mr. Husen Daudi
& Mr. Jay Vora to start a companionship that every
company around the world can relate to; No matter
it is a Multinational Firm or a Small Scale Enterprise.