Export product will lead to category assignment deletion when product is linked to several stores
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Magento OpenERP Connector |
Confirmed
|
Undecided
|
Sébastien BEAU - http://www.akretion.com |
Bug Description
Hi all,
- magentoerpconnect: revision 685 from oerp6.1-stable branch
- Magento: 1.6.0.0 using only simple products
I have products linked to 2 websites in Magento. I also have 2 root catgeories, one root category for one website / store the other root category for the other website / store. Products have category assignments in both root categories. I imported these products in OpenERP without problems, categories are correct assigned in OpenERP.
If I export products in OpenERP, e.g. via export product function in product detail view, I have to choose for what shop I want to start the export. Problem is now that only categories related to one shop will be used for the update on Magento side. These categories will replace the whole old product category assignment during the update process in Magento and so the categories of the other shop get lost.
To fix this problem I added the following function to class product_product in magentoerpconne
def _get_categories
"""
For Magento: We have to export all assigned categories (shop independent).
Otherwise we would delete category assignments during product export on
Magento side when the product have category assignments in more than one
root category. We can have several root categories for several stores.
"""
product = self.read(cr, uid, product_id, ['categ_ids', 'categ_id'], context=context)
return product_categ_ids
Regards
Robert
Hello,
Thanks for your report and your solution.
That seems correct to me, but Sébastien can you confirm and merge in oerp6.1-stable please?
I'm not confident to merge that myself as I worked on the oerp6.1-oldstable and I'm currently working on the version 7, so I don't have the necessary knowledge on this branch.
Guewen