← Back to team overview

openerp-connector-community team mailing list archive

Indirect Mapping fields

 

Hi Guys,

hope you all are doing good.

Can someone help me out with indirect mapping?
All in all it works great and without problems. It's so easy to use. Thank you!

But in Magento you can give multiply values to an attribute. For example Product 1 is colored red/blue. So to import that to OpenERP you have to map these values (Codes to text) eg. 101 = red / 102 = blue.

That works fine if one value in magento is selected. Two doesn't work.
Magento gives an API String like "101,102" for "red,blue".

Can someone give me a tip how I can handle that in the mapping class? Would be very thankful!
At the moment it is:
    @mapping
    def Farbe(self, record):
        Farbe_Magento = MAGENTO_COLOR.get(record.get('filter_color'))
        return {'Farbe': Farbe_Magento}

but I think I have to check for a "," and split it then in two parts.
But don't know how to arrange that...


Regards
Jan


Follow ups