Skip to Content
Menu
This question has been flagged
1 Odpoveď
10653 Zobrazenia

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        

Avatar
Zrušiť
Best Answer

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






Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
4
mar 20
154
2
júl 23
4081
2
nov 22
7292
5
jan 24
13959
0
aug 19
3291