← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 673696] [NEW] Server ORM bug V5. Error in read function with inherited field. Maybe V6 is also impacted

 

Public bug reported:

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.

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
Server ORM bug V5. Error in read function with inherited field. Maybe V6 is also impacted 
https://bugs.launchpad.net/bugs/673696
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: New

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.





Follow ups

References