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

Hi,

I have something like this in my xml view:

<field name="state" widget="statusbar" statusbar_visible="stock,active,inactive"/>

and my states are the following ones:

          ('stock', 'Stock'),

          ('active', 'Active'),

          ('replace', 'To Replace'),

          ('repair', 'To Repair'),

          ('receive', 'To receive'),

          ('inactive', 'Inactive')

When in "repair" state, i would like to display also "receive" state. The current behaviour of statusbar_visible is to show stock,active,inactive and repair state, and I want stock,active,inactive,repair,receive

How can I achieve that? Is there any way to change "statusbar_visible" attribute dynamically? Thanks in advance        

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

Possible duplicate topic:
https://www.odoo.com/id_ID/forum/help-1/8-show-a-state-depending-on-a-field-89160

You can create two different statusbar and hide in according to your state

In your model add both field

state_a = fields.Selection(related='state')
state_b = fields.Selection(related='state')

In view add something like these






Аватар
Отменить
Related Posts Ответы Просмотры Активность
4
мар. 20
154
2
июл. 23
4076
2
нояб. 22
7281
5
янв. 24
13952
0
авг. 19
3285