[trunk/6.1/6.0] issue with inherited field when put in child and parent is required

Bug #931202 reported by Graeme Gellatly
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Won't Fix
Low
OpenERP Publisher's Warranty Team
6.0
Won't Fix
Undecided
Unassigned
6.1
Won't Fix
Undecided
Unassigned

Bug Description

Modified code
        for v in vals.keys():
            if v in self._inherit_fields:
                (table, col, col_detail, original_parent) = self._inherit_fields[v]
                tocreate[table][v] = vals[v]
                if v not in self._columns:
                    del vals[v]

Original code
        for v in vals.keys():
            if v in self._inherit_fields and v not in self._columns:
                (table, col, col_detail, original_parent) = self._inherit_fields[v]
                tocreate[table][v] = vals[v]
                del vals[v]

The cause of this problem can be demonstrated by product and product_variant_multi module. pvm redeclares name field as part of product, yet both are required fields in template and product. When creating a product, product template creation fails because name value is not passed to create.

Now I am not saying this is the most elegant way to fix it, and one could argue it would be better done in the addons code, but both these modules existed long before the code change that introduced the error. The modified code block is how I resolved it, essentially writing the value to both models.

Tags: maintenance

Related branches

Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

sorry this is in the create method of orm.py, I imagine write has a similar issue.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

I confirm this issue in 6.0 and 6.1

Regards,

Changed in openobject-server:
assignee: OpenERP's Framework R&D (openerp-dev-framework) → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Amit Parik (amit-parik)
summary: - [trunk] issue with inherited field when put in child and parent is
- required
+ [trunk/6.1/6.0] issue with inherited field when put in child and parent
+ is required
Changed in openobject-server:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.