Community mailing list archives

community@mail.odoo.com

Avatar

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

by
Brightwave LTD, Jesse Morgan
- 04/29/2017 05:32:07
It's a bit tedious because you can't use the debug tools to inspect the sub-form when 'zooming' from a parent form - like the situation above, using Create and Edit from purchase order lines.

I've been looking through the system to try to find out what linkage tells odoo to enact which form when using create and edit - but can't find anything.

Does it take the highest priority form for the model of the field you are working with?


On 29 April 2017 at 20:39, Jesse Morgan <jmorgan.nz@gmail.com> wrote:
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, <ray.carnes@bistasolutions.com> 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 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

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



Reference