Help

2

Product Category Standard / Default

Avatar
Marco Vogels

Dear Odoo-users,

Right now we are using a dozen Product Categories within our inventory system. However, the default option that automatically shows first  when creating  a  product is the Product Category with ID #1 (This is visible when exporting these categories) but I would like this to be the category with ID #6.

But I cannot find a way to change this. Not via Studio and not in the XML code via Models or Views.

Could someone help me out please? There must be a simple way to change this.

 

I am using version 13

2 Comments
Avatar
Discard
Avatar
Midhun M M
-

while creating a new product the default product category should be ID#6 that's your requirement right?

Avatar
Marco Vogels
-

Yes that is my requirement

3 Answers
2
Avatar
Jaideep
Best Answer

Hi Marco, 

You can achieve this also by setting defaults.
1. Enable developer mode in settings
2. Start to create a new product and select the category you wish to make as default
3. Click the debug icon (top right side on the menu bar, next to activity and chat icons) and select 'set defaults'
4. On the 'default' dropdown select 'product category'
5. Select the other fields as relevant for  your  case and 'save default'
Hope this helps!
Best


1 Comment
Avatar
Discard
Avatar
Marco Vogels
-

Legend! Works perfectly, need it on more occasions. Thank you!

1
Avatar
Marcelo Pereira
Best Answer

You can override the method "_get_default_category_id()" from product.template

1 Comment
Avatar
Discard
Avatar
Marco Vogels
-

Could you elaborate further on where to add this line in detail? I suppose under product.template.common.form? And add it within <field name="categ_id" string="Product Category"/>? I don't want to mess things up and try out too much as I might be in the wrong place. I thought it could also be under product.template > Fields > categ_id? Eitherway I could not get it to work properly as I think I might be doing it wrong. As you see not familiar with coding.

0
Avatar
Marco Vogels
Best Answer

Hi Marcelo, could you elaborate on my comment above? Thank you in-advance!

Avatar
Discard