This question has been flagged

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
Discard
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
Discard