Merge lp:~openerp-dev/openobject-server/6.1-opw-574902-avp into lp:openobject-server/6.1

Proposed by Avadhesh Patel (openerp)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-server/6.1-opw-574902-avp
Merge into: lp:openobject-server/6.1
Diff against target: 30 lines (+4/-5)
1 file modified
openerp/modules/loading.py (+4/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.1-opw-574902-avp
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+106171@code.launchpad.net

Description of the change

Hello Naresh,

I have Solved The following Problem.

The data files declared in __openerp__.py,
section "init_xml" are all the time reloaded when you update a module.
The files declared in init_xml should not modify any existing records.

Kindly review the code.

Thanks,
AVP.

To post a comment you must log in.
4175. By Juan Rial (OpenERP)

[FIX] : [574902] : XML files declared in init_xml are reloaded on restart - remove redundant test, update doc

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

hello,

What if the kind == 'init' and the extension is .csv ?

Thanks,

review: Needs Fixing
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

4175. By Juan Rial (OpenERP)

[FIX] : [574902] : XML files declared in init_xml are reloaded on restart - remove redundant test, update doc

4174. By avp <openerp@openerp-laptop>

[FIX] : XML files declared in init_xml are reloaded and data is updated(Case: Ref 574902)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/modules/loading.py'
2--- openerp/modules/loading.py 2012-02-20 10:59:43 +0000
3+++ openerp/modules/loading.py 2012-06-05 06:56:19 +0000
4@@ -113,22 +113,21 @@
5
6 kind: data, demo, test, init_xml, update_xml, demo_xml.
7
8- noupdate is False, unless it is demo data or it is csv data in
9+ noupdate is False, unless it is demo data or we're in
10 init mode.
11
12 """
13 for filename in package.data[kind]:
14- _logger.info("module %s: loading %s", module_name, filename)
15+ if mode == 'init' or (mode == 'update' and kind != 'init_xml'):
16+ _logger.info("module %s: loading %s", module_name, filename)
17 _, ext = os.path.splitext(filename)
18 pathname = os.path.join(module_name, filename)
19 fp = tools.file_open(pathname)
20 noupdate = False
21- if kind in ('demo', 'demo_xml'):
22+ if kind in ('demo', 'demo_xml', 'init_xml'):
23 noupdate = True
24 try:
25 if ext == '.csv':
26- if kind in ('init', 'init_xml'):
27- noupdate = True
28 tools.convert_csv_import(cr, module_name, pathname, fp.read(), idref, mode, noupdate)
29 elif ext == '.sql':
30 process_sql_file(cr, fp)