← Back to team overview

magentoerpconnect-community team mailing list archive

Re: Import attribute value for a product directly in database

 

Hi Yannick,

By default, the attributes are stored in a json field
(fields.serialized) in product_template.
The name of the field is: magerp_tmpl

Some of them are stored in product_product so their value can be
different per product variant.
The name of the field here is: magerp_variant
You can see the list of these fields in magentoerpconnect/product.py
in the attribute: magerp_product_attributes._variant_fields

Finally, some of them are enforced to be stored as regular fields.
You can see the list of these fields in magentoerpconnect/product.py
in the attribute: magerp_product_attributes._not_store_in_json


So in your case you will need to store in product_product.magerp_variant:
{"x_magerp_color": 100}
where 100 is the id of the option "blue".
Color is not in _not_store_in_json, but is declared in _variant_fields.

You can also change these attributes to customize how your attributes
will be stored.

Guewen



On Thu, Jul 19, 2012 at 2:29 PM, Yannick Buron
<yannick.buron@xxxxxxxxxxx> wrote:
> Hi everyone,
>
> I need your help for an importation in an OpenERP which use
> magentoerpconnect. All attribute, attribute set and attribute value was
> defined in magento and then imported in OpenERP.
>
> Now I am importing the product in OpenERP, and I need to assign the good
> value for each attribute of each product. For exemple saying that the color
> attribute of product X is blue.
>
> In my data flow, I have the product_id, the attribute_id and the option_id.
> I should have everything needed so that I can import this but my problem is
> that I am not able to find the table which store this value. I know the
> table which store the product, the one which store the attribute, the one
> which store the attribute_option, but not the one which store the relation
> between them.
>
> Where is stored this relation?
>
>
> Regards,
> Yannick.
>


References