Community mailing list archives

community@mail.odoo.com

Avatar

RE: [v9] 'Create and Edit' product from purchase order strange behaviour

by
Ray Carnes
- 04/29/2017 01:41:40

This is probably the difference between product.template and product.product (which inherits product.template).

 

When creating directly from a Purchase Order, you are creating a product.product:

 

Also at http://i.imgur.com/0jYTS3j.png

 

When creating products from the Products menus, you are creating a product.template

 

Also at http://i.imgur.com/f77jGbA.png

 

Ray.

 

From: Jesse Morgan [mailto:jmorgan.nz@gmail.com]
Sent: Friday, April 28, 2017 8:46 PM
To: Community <community@mail.odoo.com>
Subject: [v9] 'Create and Edit' product from purchase order strange behaviour

 

Hi All,

 

I have a self-made module which sets some defaults on product.product.

It defaults the barcode field to 'AUTO', then in model.write it detects the word AUTO, and if found generates a new barcode from an ir.sequence.

 

This all works great when creating or editing a product directly from the products tree view.

However, when entering a product through a purchase order (using create and edit), my code doesn't appear to be called at all.

 

The default does not appear, and if I type it in manually, it is not translated into a barcode # - but written to the database vanilla.

 

This makes me feel like some code other than in the product.product model is running when using the create and edit function.

 

Has anyone else run into anything like this?

 

Cheers,

Jesse

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

Reference