Odoo Help

0

[v8] how to change the product template, so a new product is marked as 'Stockable Product' by default

By
gunnar
on 3/3/15, 8:07 PM 1,552 views

the question says is all basically when creating a new product by default it is marked as "consumable product'. In my case I almost always want to create a 'Stockable Product' though. Is there a way to set this up as the default option?

Hi,, Have you tried giving default for that field??

Baiju KS
on 3/4/15, 1:16 AM

no. how would you do that?

gunnar
on 3/4/15, 1:36 AM
0
Michael Thomas
On 3/3/15, 9:01 PM

Through the GUI I don't believe so. I don't see a way anyway. You should be able to do it programatically. 

The field you are looking for is the "type" field in the product.template model. It is originally defined in /addons/product/product.py. You can change it in that file, but it may not work since I think this column is inherited and changed somewhere else. Best practice is to create a custom module and inherit the model with this column:

 'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, default='product' help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual.")

Also, you will find information on the default fields in the ORM API docs for 8.0:

https://www.odoo.com/documentation/8.0/reference/orm.html#creating-models     

0

Hi Gunnar,

You can set default value for any of field from selected form view. Just see the below screen. User can set default value from "debug" mode.

Set Default Screen

I hope this will help you.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 3/3/15, 8:07 PM
Seen: 1552 times
Last updated: 8/27/16, 4:32 AM