Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
10624 Lượt xem

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        

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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






Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 3 20
154
2
thg 7 23
4073
2
thg 11 22
7279
5
thg 1 24
13947
0
thg 8 19
3284