Skip to Content
Menu
This question has been flagged

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

Avatar
Discard

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

Author

Yes that is my requirement

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


Avatar
Discard
Author

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

Best Answer

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

Avatar
Discard
Author

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.

Author Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
3
Jul 24
2472
1
Feb 23
1543
3
Feb 21
9969
1
Aug 18
4391
12
Sep 17
8150