← 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

 

Assigning to support team for backport to 5.0 if they think the risk is
low enough and the bug is important enough..

** Also affects: openobject-server/5.0
   Importance: Undecided
       Status: New

** Changed in: openobject-server/5.0
   Importance: Undecided => Low

** Changed in: openobject-server/5.0
       Status: New => Confirmed

** Changed in: openobject-server/5.0
     Assignee: (unassigned) => Anup (OpenERP) (ach-openerp)

** Tags added: maintenance

-- 
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:
  Confirmed

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