openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #06904
[Bug 931202] [NEW] [trunk] issue with inherited field when put in child and parent is required
Public bug reported:
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.
** Affects: openobject-server
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/931202
Title:
[trunk] issue with inherited field when put in child and parent is
required
Status in OpenERP Server:
New
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/931202/+subscriptions
Follow ups
-
[Bug 931202] Re: [trunk/6.1/6.0] issue with inherited field when put in child and parent is required
From: Christophe Chauvet - http://www.syleam.fr/, 2012-08-23
-
[Bug 931202] Re: [trunk/6.1/6.0] issue with inherited field when put in child and parent is required
From: Hardik Ansodariya (OpenERP), 2012-08-22
-
[Bug 931202] Re: [trunk/6.1/6.0] issue with inherited field when put in child and parent is required
From: Amit Parik (OpenERP), 2012-08-22
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Hardik Ansodariya (OpenERP), 2012-08-22
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Hardik Ansodariya (OpenERP), 2012-08-22
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Vinay Rana (openerp), 2012-07-26
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Christophe Chauvet - http://www.syleam.fr/, 2012-07-25
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Olivier Dony (OpenERP), 2012-02-13
-
[Bug 931202] Re: [trunk] issue with inherited field when put in child and parent is required
From: Graeme Gellatly, 2012-02-13
-
[Bug 931202] [NEW] [trunk] issue with inherited field when put in child and parent is required
From: Graeme Gellatly, 2012-02-13
References