← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 673194] Re: Recursive copy of translations causes infinite loop when there is a cycle in the related fields

 

Thanks for the proposed fix Don!
I have use a different strategy to attempt to cover more cases, keeping track (via the context) of already visited records during copy of translations (and copy of data as well!). This solves the issue with product_multi_variant, and also removes the need for the overriding copy() in case of circular relationships.

The fix has landed in trunk with revision 3055 odo@xxxxxxxxxxx-20101130110940-0tf6ra0uwhiptieb
Thanks for reporting!

** Changed in: openobject-server
       Status: In Progress => Fix Released

-- 
Recursive copy of translations causes infinite loop when there is a cycle in the related fields
https://bugs.launchpad.net/bugs/673194
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: Fix Released

Bug description:
If you set up related fields that have a cycle, then duplicating a record goes into an infinite loop.

For example, install the product_variant_multi module from extra-addons. It has a relationship from product_product to product_template, and one from product_template to product_product. Once you've installed it, try to duplicate one of the products using the Form: Duplicate menu item. It will go into an infinite loop and never finish. The server will not respond to SIGINT.

It looks like this problem occurred in revision 2075 of the 5.0 branch during release 5.0.12. Olivier Dony implemented "proper recursive copy of translations through one2many relationships during copy()". Before that, it appears the product_variant_multi module had successfully avoided problems with the related fields cycle by overriding the product_product.copy() method and the product_template.copy() method and using the default parameter to skip one of the relationships in the cycle. I can't see any way to similarly skip a relationship in the copy_translations() method.

I have reproduced the problem using release 5.0.15 of the 5.0 branch.





References