Community mailing list archives


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

Brightwave LTD, Jesse Morgan
- 04/29/2017 04:39:30
Yep, figured this one out but you beat me to it!
Made my changes on product.product too, and all is well.

Thanks for the info!

On 29 April 2017 at 17:45, <> wrote:

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


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


Also at




From: Jesse Morgan []
Sent: Friday, April 28, 2017 8:46 PM
To: Community <>
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?




Post to:

Post to: