Help

what is 'data' field in __openerp__.py file

Closed
Avatar
priyankahdp

The question has been closed

by
priyankahdp
on 04/18/2013 07:31:06
{
    'name' : "OpenAcademy",
    'version' : "1.0",
    'author' : "OpenERP SA",
    'category' : "Tools",
    'depends' : ['mail'],
    'data' : [
        'openacademy_view.xml',
        'openacademy_data.xml',
        'report/module_report.xml',
        'wizard/module_wizard.xml',
    ],
    'demo' : [
        'openacademy_demo.xml'
    ],
    'installable': True,
}

please tell me what is the usage of that 'data' field. if you can please show & explain the sample using student module

Avatar
Discard
2 Answers
2

Hello,

"data" field in v7 is same as "update_xml" field in v6.1. You can also write "update_xml" instead of "data" in v7.

This field is list of .xml files to load when the server is launched with the “–update=module” launched. Filepaths must be relative to the directory where the module is. OpenERP XML File Format is detailed in this section.

Thanks, Serpent Consulting Services.

1 Comment
Avatar
Discard
Avatar
qwq
-

DATA not the same as UPDATE_XML. It can load data only at INSTALL or always (depending from attribute of record), but UPDATE_XML load always. Always mean INSTALL and UPDATE. For new modules better use DATA, because UPDATE_XML will deprecated.

4
Avatar
Vasiliy Birukov
Best Answer

It describe list of files (CSV, YAML or XML) with data, that load to DB when module install or update.

2 Comments
Avatar
Discard
Avatar
priyankahdp
-

thanks wowas, then what is the usage of it.? is it like __openerp__.py depends field.?it also load the data.isn't it.?

Avatar
Vasiliy Birukov
-

If you need use in module, for example, file FILENAME.XML you must add it to DATA list in __openerp__.py: 'data' : [ 'filename.xml', ], then when you install or update your module system will scan this file. DEPENDS list cause that system will install pointed modules, when you install your module.