[trunk] regression in product.product when create with product_tmpl_id

Bug #527263 reported by Jean-Sebastien SUZANNE - http://www.Syleam.fr
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
Trunk
Fix Released
Medium
Stephane Wirtel (OpenERP)

Bug Description

Hi

trunk
server rev 2088
addons 2995

install product, base with demos

create a product with an existing product_tmpl_id.

 * the new product.product is create with a new product_tmpl_id.

Regards Jean-Sébastien

Related branches

security vulnerability: yes → no
visibility: private → public
Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Medium
affects: openobject-server → openobject-addons
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi stephane

I don't think the problem is only to product module

After investigation with Jean-Sébastien we see the problem with _inherits (on product_product and product_template)

Regards,

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Jean-Sébastien,

This is neither a bug nor a regression.

The _inherits fundamental has this virtue that when you create a record of child object(here its product.product), its create() method goes to the parent object(product_template) and create its new associative record.

Now, how can you assign product_tmpl_id (an existing one) to a newly to-be-created(unsaved) record ?

I hope this helps.

Queries Invited.

Thanks.

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi Jay

That a bad regression from 5.0, the module product_multi_variant doesn't work anymore

Bad day for OpenERP

Regards,

Revision history for this message
Jean-Sebastien SUZANNE - http://www.Syleam.fr (alnjssuza) wrote :

Hi Jay

In the attachment, I create a product.product with a product.template.

I assign the id of the product.template in the field product_tmpl_id when the product.product create. look the attachement for more detail.

this is the revno of the last test
Server revno: 2091
Addons revno: 3102
Client revno: 1183

If you want test quickly
 * install product_variant_multi in a new data base without demo
 * create a group property color white, black, red, ...
 * create a product template. in the page Variants, add the the dimension type color, and click on generate.

 you can see that on the trunk he create template or on the 5.0.7rc2 he doesn't create template and create products with the template

Regards Jean-Sébastien

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : Re: [Bug 527263] Re: [trunk] regression in product.product when create with product_tmpl_id

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jean-Sebastien,

Your code is wrong, you have a problem with your indent, can you check..

Thanks

Jean-Sebastien SUZANNE - http://www.Syleam.fr wrote:
> Hi Jay
>
> In the attachment, I create a product.product with a product.template.
>
> I assign the id of the product.template in the field product_tmpl_id
> when the product.product create. look the attachement for more detail.
>
> this is the revno of the last test
> Server revno: 2091
> Addons revno: 3102
> Client revno: 1183
>
> If you want test quickly
> * install product_variant_multi in a new data base without demo
> * create a group property color white, black, red, ...
> * create a product template. in the page Variants, add the the dimension type color, and click on generate.
>
> you can see that on the trunk he create template or on the 5.0.7rc2 he
> doesn't create template and create products with the template
>
> Regards Jean-Sébastien
>
> ** Attachment added: "inherit_product_regression_or_bug.py"
> http://launchpadlibrarian.net/40085542/inherit_product_regression_or_bug.py
>

- --
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Quality/Release Manager
Technical Project Manager
Tiny SPRL
40, Chaussee de Namur
B-1367 Grand-Rosiere
* Tel: +32.81.81.37.00
* Fax: +32.81.73.35.01
* Web: http://www.openerp.com
* Planet: http://www.openerp.com/planet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuOhHYACgkQnqh8s27uQNXFagCggNlCm39jqjt296JHW9aFucpm
3CkAoNpHcET5V04/jxrnXZBDsgpv6z9h
=rwgx
-----END PGP SIGNATURE-----

Revision history for this message
Jean-Sebastien SUZANNE - http://www.Syleam.fr (alnjssuza) wrote :

Hi Fabien

this is the file with the good indent

Regards

Jean-Sébastien

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Fabien ? euh not, but Stephane is right ;-)

Sorry, but your code is always wrong.

Revision history for this message
Jean-Sebastien SUZANNE - http://www.Syleam.fr (alnjssuza) wrote :

Sorry Stephane

this is the real right code

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Dear Jean-Sébastien,

In OpenERP terms, one cannot link the existing record (of parent- _inherits) to to-be-created child one.

If this issue is available in any module, then the module has to be improved.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Are you sure its working in 5.0?
Let us know please.

Revision history for this message
Jean-Sebastien SUZANNE - http://www.Syleam.fr (alnjssuza) wrote :

Hi Jay

Yes it's working on the 5.0.

For the trunk use the syleam branch : lp:~syleam/+junk/trunk-product_variant_multi

Jean-Sébastien

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

I fixed the bug with the following revision.
http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/2132

2132 <email address hidden>

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Guys,

A simple example to treat with:
Product.product have _inherits to product_template.
I am creating a new product with all the values,weight,Volume(these fields belong to template table) and an EXISTING product_tmpl_id. Let us say its saved.

Now, What if I try to read the weight of the newly created product? What value will it retrieve? It will only retrieve the value of RELATED Template ID which we just linked, not the value we entered while saving the form.

Please, let me know if this is wrong.

@Stephane,

I guess, this fix will create problems for MULTILEVEL _Inherits.

Thanks.

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Are you sure about the Multilevel _inherits ? Do you have an example ?

Thanks

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.