Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3029 Представления

I added couple fields to a maintenance equipment model as well as additional equipment category. Then I displayed them inside desired view.

Now I want to make them visible only if equipment that is currently opened has particular category.
I tried something like this:

<page string="Description">
<field name="note"/>
<div t-if="category_id.id == 1">
<group>
<field name="x_CPU_1"/>
<field name="x_CPU_2"/>
</group>
<group>
<field name="x_RAM_1"/>
<field name="x_RAM_2"/>
<field name="x_RAM_3"/>
<field name="x_RAM_4"/>
</group>
</div>
</page>

But it does not change anything, I still see everthing no matter what category has this particular equipment.

This fields should only be visible in custom category called "Laptop" which is my custom category and in metadata it has ID 1.  

I also tried making condition with "1" or like this:

category_id.name == 'Laptop'

But it does not work as well.

Аватар
Отменить
Лучший ответ

Hello 

see this below link. There is same scenario that's you have.

https://www.odoo.com/forum/help-1/question/how-to-hide-some-fields-based-product-category-153334#answer-153335

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
сент. 21
5619
3
сент. 20
3203
3
дек. 19
3143
1
нояб. 19
4891
2
янв. 19
3614