[base_module_record] doesn't generate correct XML ID if one was provided

Bug #777235 reported by OpenBMS JSC
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 1

Bug Description

When exporting data with base_module_record, the XML ID for records are generated randomly (as if with the case when data are entered via UI, and do not have XML ID), even if these records are initialized via __openerp__.py sections. However, if these data reference to other records that have XML ID, it does generate correct reference (ref="<XML ID>").

This behavior is inconsistent with exporting data from CSV (where correct XML ID are generated, and empty is generated for data that is not initialized with XML ID). It also make it difficult to sync between preconfigure data and data updated during development.

Revision history for this message
xrg (xrg) wrote : Re: [Bug 777235] [NEW] [base_module_record] doesn't generate correct XML ID if one was provided

On Wednesday 04 May 2011, you wrote:
> Public bug reported:
>
> When exporting data with base_module_record, the XML ID for records are
> generated randomly (as if with the case when data are entered via UI,
> and do not have XML ID), even if these records are initialized via
> __openerp__.py sections. However, if these data reference to other
> records that have XML ID, it does generate correct reference (ref="<XML
> ID>").
>
> This behavior is inconsistent with exporting data from CSV (where
> correct XML ID are generated, and empty is generated for data that is
> not initialized with XML ID). It also make it difficult to sync between
> preconfigure data and data updated during development.
>

Please, if you can afford a little time, test my version of the module. I had,
long ago, tried to fix this behaviour. But, I warn you, my version seemed to
sometimes yield multiple xml "versions" of the same record (don't know if the
official does the same).

http://git.hellug.gr/?p=xrg/openobject-
addons;a=tree;f=base_module_record;h=77978ae522c64529c87a279bc1eb57bb8a407f42;hb=HEAD

If this version fixes your bug, we should seek to backport the changes into 6.0
or 6.1

Revision history for this message
OpenBMS JSC (openbmsjsc) wrote :

Didn't know that there is some improvement. I'll test and let you know.

Revision history for this message
OpenBMS JSC (openbmsjsc) wrote :

Hi,

I just skim through the code, and wonder if this should be change to utf-8

    _out_encoding = 'iso-8859-1'

Revision history for this message
OpenBMS JSC (openbmsjsc) wrote :

I have done a quick test, and here are the results

1. It doesn't fix the behavior of generating random XML ID for records that already have XML ID (e.g. I create a new DB with demo data, load some initialization data from XML, and export back the data, but all exported XML IDs are recreated with random values.

2. It does generate multiple versions of data (same values with different ID), especially if "Create & Modified" option is selected. This behavior is same for the official version (the one that was release with addons 6.0.2). This is not good, since we cannot take the exported data as the initial values for newly created DB (multiple data will appear).

Revision history for this message
xrg (xrg) wrote : Re: [Bug 777235] Re: [base_module_record] doesn't generate correct XML ID if one was provided

On Thursday 05 May 2011, you wrote:
> Hi,
>
> I just skim through the code, and wonder if this should be change to
> utf-8
>
> _out_encoding = 'iso-8859-1'

well, thanks for reminding me that :) Commit message is just enough.

http://git.hellug.gr/?p=xrg/openobject-addons;a=commitdiff;h=f2f6cb595ac1e901

Revision history for this message
xrg (xrg) wrote :

On Thursday 05 May 2011, you wrote:
> I have done a quick test, and here are the results
>
> 1. It doesn't fix the behavior of generating random XML ID for records
> that already have XML ID (e.g. I create a new DB with demo data, load
> some initialization data from XML, and export back the data, but all
> exported XML IDs are recreated with random values.
>
> 2. It does generate multiple versions of data (same values with
> different ID), especially if "Create & Modified" option is selected.
> This behavior is same for the official version (the one that was release
> with addons 6.0.2). This is not good, since we cannot take the exported
> data as the initial values for newly created DB (multiple data will
> appear).

hmm. Then, I guess, I/we should revisit the code and find a way to improve it.

--
Say NO to spam and viruses. Stop using Microsoft Windows!

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Manu (manu-tiedra) wrote :

Amit, I don't see this as a wishlist. It is a bug that makes difficult to sync between preconfigured data and data updated during development, making base_module_record useless for updated data, so it is at least medium importance IMHO.

Revision history for this message
jerzyo (jerzyo) wrote :

Anyone wrking on it?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.