← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Hello Sébastien,

      This is a new feature. It does not seem to be a blocking point, it
does not break the system. IMHO it should be kept for the newer
version(6.0).

Thanks.

** Changed in: openobject-server/5.0
       Status: In Progress => Won't Fix

-- 
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:
  Won't Fix

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