c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #10470
[Bug 673696] Re: Server ORM bug V5. Error in read function with inherited field. Maybe V6 is also impacted
** Changed in: openobject-server/5.0
Status: Confirmed => In Progress
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/673696
Title:
Server ORM bug V5. Error in read function with inherited field. Maybe V6 is also impacted
Status in OpenObject Server:
Fix Released
Status in OpenObject Server 5.0 series:
In Progress
Bug description:
We are working on product_variant_multi and so using inherited fields.
If you add the field "name" to the object product.product, the "read" function on the object product.product will give you the result of the field "name" of the object product.template.
If you look at orm.py, line 2333 :
You will see that the ORM doesn't make any check on the existing fields in product.product before reading them in product.template.
I just added a check
- cols = intersect(self._inherit_fields.keys(), fields_to_read)
+ cols = [x for x in intersect(self._inherit_fields.keys(), fields_to_read) if x not in self._columns.keys()]
For information : "cols" is the variable which contains the fields that we have to read in the inherited object.
With this patch fields are only read in the inherited object if they are not found in the actual object.
References