Export only changed categories for OpenERP v5

Bug #669901 reported by Guewen Baconnier @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
Undecided
Vianney - www.akretion.com.br

Bug Description

Hello,

I saw you have developed the blueprint export-only-changed-categories, thank you, it's a nice improvement (it was taking so time to update some products when you have +2000 categories ;-).

As we need it in OpenERP v5 I backported it and it works nice. I had nothing to change on your method from v6 to v5.

Thank you,
Regards,
Guewen

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :
description: updated
Changed in magentoerpconnect:
status: New → Confirmed
Revision history for this message
Vianney - www.akretion.com.br (vianneydc) wrote :

Hello,

thanks once again for pointing this out, I'm using your patch right now and I'll push the update.

Changed in magentoerpconnect:
assignee: nobody → Vianney - www.akretion.com.br (vianneydc)
status: Confirmed → Fix Released
Changed in magentoerpconnect:
status: Fix Released → Confirmed
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello,

I noticed that the categories are not exported at the first export of the catalog on the version 5.
I checked on the version 6 connector and Sebastien Beau has already corrected that issue (and a second one for the categories order).
Here is the patch for the version 5 with his corrections.

Regards,
Guewen

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 669901] Re: Export only changed categories for OpenERP v5

Hello, yes, seems we probably did not took the risk to backport that fix on
the 5.0 branch indeed (we do that only when our v5 customer really ask for
it). But if you or some other trustable community member test it, of course
we will merge it. So thank you for the work!

On Thu, Dec 23, 2010 at 7:48 AM, Launchpad Bug Tracker <
<email address hidden>> wrote:

> ** Branch linked: lp:~gbaconnier-c2c/magentoerpconnect/magentoerpconnect
>
> --
> You received this bug notification because you are subscribed to Magento
> Open ERP Connector.
> https://bugs.launchpad.net/bugs/669901
>
> Title:
> Export only changed categories for OpenERP v5
>
> Status in Magento Open ERP Connector:
> Confirmed
>
> Bug description:
> Hello,
>
> I saw you have developed the blueprint export-only-changed-categories,
> thank you, it's a nice improvement (it was taking so time to update some
> products when you have +2000 categories ;-).
>
> As we need it in OpenERP v5 I backported it and it works nice. I had
> nothing to change on your method from v6 to v5.
>
> Thank you,
> Regards,
> Guewen
>
>
>

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello,

The "export only changed categories" in the connector for version 5 was not fine, so I'm sorry because I did not test enough my patch the last time.

The buggy use case is :
 - Creation of a category A in OpenERP
 - Creation of a category B in OpenERP
 - Set the category A as child of category B
 - Export the catalog
 - The connector creates the category A and after it creates the B. Normally it must create the B first, then the A below the B.

After many tests and debug, I found the problem.
I have pushed the correction of the connector on a branch : http://bazaar.launchpad.net/~gbaconnier-c2c/magentoerpconnect/magentoerpconnect/revision/361

As you may see, it is a small modification. In the mapping script of the parent_id, when the parent category does not exist, it calls ext_export to create it. But the ext_export method in magentoerpconnect/product.py needs the context's element "shop_id" which was not passed. Then the parent category was not created on Magento. I'm not sure if we have to pass the entire context variable or only the shop_id value.
I wonder if you have the same issue on the version 6 because the shop_id is not passed either.

The 2 lines modified in product.py are just to maintain the sorting of the categories and is a backport from the connector version 6.

To maintain the sorting, we also have to backport that revision on extra-addons : http://bazaar.launchpad.net/~openerp-commiter/openobject-addons/trunk-extra-addons/revision/5092.1.36
to ensure the order of the categories is maintained.
I have attached a patch with the modifications to apply on extra-addons version 5.0.

I tested a lot this correction, with creations of all categories from empty / updates / adds and indeed no update of the categories and it works well.

Hoping that will be useful.

Thanks & Regards
Guewen

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Guewen, sounds good, we will have the opportunity to test that in v6
soon, thanks!

On Tue, Jan 4, 2011 at 2:14 PM, Guewen Baconnier @ Camptocamp <
<email address hidden>> wrote:

> ** Patch removed: "Backported corrections for categories export"
>
> https://bugs.launchpad.net/magentoerpconnect/+bug/669901/+attachment/1760581/+files/export_categories_first.patch
>
> --
> You received this bug notification because you are subscribed to Magento
> Open ERP Connector.
> https://bugs.launchpad.net/bugs/669901
>
> Title:
> Export only changed categories for OpenERP v5
>
> Status in Magento Open ERP Connector:
> Confirmed
>
> Bug description:
> Hello,
>
> I saw you have developed the blueprint export-only-changed-categories,
> thank you, it's a nice improvement (it was taking so time to update some
> products when you have +2000 categories ;-).
>
> As we need it in OpenERP v5 I backported it and it works nice. I had
> nothing to change on your method from v6 to v5.
>
> Thank you,
> Regards,
> Guewen
>
>
>

Changed in magentoerpconnect:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.