Server ORM bug V5 (copy translation). Error when duplicating product, using product_variant_multi
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Won't Fix
|
Undecided
|
Somesh Khare | |||
Trunk |
Fix Released
|
Medium
|
OpenERP's Framework R&D |
Bug Description
Hi
After installing product_
Indeed, If you look in the orm, a recursive function is used to duplicated all of the translation.
In the case of the product_
Here are the relation between the two object
"product.
"product.
Note : the object "product.product" have as field the field "variants_ids" in the list of its fields indeed it inherit the product.template.
When we try to duplicate the translation, we use the recursive method on all many2one and one2many fields.
The first called is done on the object "product.product". As this object have the fields variants_ids which is a related fields (one2many) related to "product.product", the recursive function is called with the same value, and we enter in a infinite loop. By chance the ORM stop the process after X recursion, and raise an error.
I join a patch.
Hope it will help.
Changed in openobject-server: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
Changed in openobject-server: | |
assignee: | OpenERP's Framework R&D (openerp-dev-framework) → SKH(OpenERP) (skh-openerp) |
Hello Sébastien,
Your patch solves the issue undoubtedly for _inherits, but its not accurate as it breaks the flow of copy for the objects which have O2M relation with itself(i.e. account, category,locations, etc.).
Not only the check of same relation is to be maintained,but also it needs to check the ID which is being copied.
With the new patch attached, you will be able to understand what I meant here.
Share your words please.
Thanks.