Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
5465 Visualizações

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
Cancelar

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

Autor

Yes that is my requirement

Melhor resposta

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
Cancelar
Autor

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

Melhor resposta

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

Avatar
Cancelar
Autor

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.

Autor Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
jul. 24
2667
1
fev. 23
1645
3
fev. 21
10128
1
ago. 18
4477
12
set. 17
8316