← Back to team overview

magentoerpconnect-community team mailing list archive

Re: [Openerp-expert-framework] base_external_referentials: change in ir_model_data use: pay attention to upgrade!

 

2010/3/22 Cloves Almeida <cjalmeida@xxxxxxxxx>

>  Raphael,
>
> where can I get more info about base_external_ referentials? The
> magento_openerp_synchro module in addons-extras doesn't seem to use it.
>

Colves, forget the magento_openerp_synchro, that the old Magento connector I
largely participated to build when I was working at Smile, but it seems
Smile has not been willing to maintain it since. Since then, Sharoon Thomas
created a new connector with a much more saner structure. I join this
project too (Openlabs and Akretion have almost half the commits each), the
new magentoerpconnect was born:
https://launchpad.net/magentoerpconnect
<https://launchpad.net/magentoerpconnect>
Because this is a large module (the most complex OpenERP module I've ever
seen), we maintain it as a separate Launchpad project too.

base_external_referentials is one of the underlining modules, it's it to be
found in the stable extra addons
https://code.launchpad.net/~openerp-commiter/openobject-addons/stable_5.0-extra-addons



> If I understand correctly, with it I can have multiple "external_id"
> properties and use the standard XML loading process to load data, reference
> it using these external IDs.
>

You got it exactly. Read the module description. Notice that even OOOR knows
how to handle ir_model_data ids, so that's very integrated when you use also
TermniatOOOR (OOOR inside the Kettle ETL) for instance.


> My need is to reference the object with a UUID and every system would
> translate it into the local ID. For instance, the res_partner[id=5] object
> would have a [uuid="unique_uuid"] attribute and serializations would dump
> it.
>

You can have a unique absolute ID indeed. In that case however you can very
well use the standard ir_model_data feature of OpenERP.

The reason why we built base_external_referentials is that actually most of
systems won't let you use your own absolute id as OpenERP does. Take Magento
example: you can have a custom unique absolute id for products: the "SKU"
code. Now, for partners, partner adresses, orders, well Magento wouldn't let
you do refer to them using your own id. So having the smarter OpenERP be
able to know what is the equivalent Magento id of order x in Magento
installation y, is a life saver. And it would work with many systems, not
just Magento and not just ecommerce.

base_external_referentials also has over nice features such as:
- easy on the fly conversion of external id to OpenERP id and the reverse.
- allows custom Python mapping to easily customize mappings between systems
without the burden of having to code a new module or hack an existing one.



> Since this uuid attribute is not a "business" concern, it would be more
> elegant if it's not implemented as a model "column".
>

In our case, after talking that with Fabien a few months ago, we didn't
implemented it as column indeed (unlike all existing ecommerce modules
around). The reason was that each id would add a column, that wouldn't scale
very well, specially at runtime. Moreover, external synch seems to totally
bound to network and per record API limitation/slowness, so having a large
ir_model_data to look up for external ids is totally negligible in front of
those bottlenecks.


Hope this helps,

feel free to ask if you have any further question about that.


Raphaël Valyi
http://www.akretion.com

References