← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 673614] Re: Base_external_referential : ID problem with export-import CSV

 

Hi Raphaël,


It comes from here (ir_model.py) :

def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None):
        warning = True
        model_obj = self.pool.get(model)
        if not context:
            context = {}
        if xml_id and ('.' in xml_id):
            assert len(xml_id.split('.'))==2, _('"%s" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id') % (xml_id)
            warning = False
            module, xml_id = xml_id.split('.')
        if (not xml_id) and (not self.doinit):
            return False
        action_id = False

And it's because they consider only one dot in xml_ids... :( !

I think we must choose another separator (like two underscore : '__')
for us in base_external referential. I suggest also that once this
change happen, we should have a was to convert the old one to new one in
the appropriate __init__ function. So it'll be transparent for the end
user.

This is quite critical, cause the import/export on product are widely
used !

What do you think ?

Regards,

Joël

-- 
Base_external_referential : ID problem with export-import CSV
https://bugs.launchpad.net/bugs/673614
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in Magento Open ERP Connector: Confirmed

Bug description:
Hi everyone,

Today I needed to tick a checkbox field on 2000+ product in OpenERP with magentoerpconnect enabled. To do it, I used the easiest method : a CSV export of all the products with column "Database ID", "Name", and the field checkbox.

I modified the checkbox field to True in my OpenOffice Calc, and then I re-imported the CSV in OpenERP.

But I had a very ugly message : 

Error trying to import this record :
	track_production: True

Error message :
Line 1 : "extref.society_name.product.product_8" contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id

I should precise that I didn't try to import the column "Id". But after this I did a CSV export with the column "Id" and I effectively get the value "extref.society_name.product.product_8".

I don't know why I had a bug with a field that was not imported, probably because it was the field "Id" that is relatively important for OpenERP.

Anyway, my devs men say to me that this absolutely not normal that we have an Id with several dots, and so there is several very bad consequences on the CSV system. For example here, Impossible to modify a product by update CSV.

I see in Administration / Customization / Database Structure / External Referential / Data two interesting fields  : module and XML identifier. For example with the example product, I have 
Module : product.product_8
XML identifier : extref.society_name

This quite obvious that the id is generated by base_external_referential with the concatenation "Module"."XML identifier". But this is bad because with this approach we have an id with several dots. I am already surprised that only the CSV system was compromised.

What do you think?





References