تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
7376 أدوات العرض

My python code is:

status = fields.Selection (string = 'Status', copy = False, selection = [('new', 'New'), ('canceled', 'Canceled'), ('accept', 'Accepted'), ( 'sold', 'SOLD')], default = 'new')

My xml is:





I  only  get  the  display  of  the current  status of each record, instead of a list of status with current status highlighted. Help is highly appreciated.

الصورة الرمزية
إهمال
أفضل إجابة

Yes, I have the same problem in my view file. I think it will be solved if I delete another filed of state.

الصورة الرمزية
إهمال
أفضل إجابة

I had the same issue.

If you have another status/state field in the same form, delete it. this would solve the issue and the statusbar will display correctly.

الصورة الرمزية
إهمال
أفضل إجابة

Hi Albert:

Add the statusbar_visible attribute to the field in the form view xml and  include  the  values  of  each  status  you  want  displayed. 

For example,

<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>

                
الصورة الرمزية
إهمال
الكاتب

Thank you very much for your help. I found that the xml code does not show on my post. But I do add the status_visible as you suggested. Here they are:
<field name="status" widget="statusbar" statusbar_visible="new,receive,accept,sold,cancel" />

أفضل إجابة

Hi,

Seems xml code is missing in the questions. If you need to display only the current status in the statusbar, i think it wont be possible using the statusbar widget, unless you make some enhancement on that widget.

If you need to limit the visibility to limited states by default, you can use the option of statusbar_visible:   statusbar_visible="draft,confirm,done"


If the above is not okay for you, better you display the state inside the form as a normal field or as a ribbon.


Thanks

الصورة الرمزية
إهمال
الكاتب

Thank you very much for your help. I am sorry that the xml code did not appear on my post although I thought I did paste it. Here they are:
<field name="status" widget="statusbar" statusbar_visible="new,receive,accept,sold,cancel" /> . I want it to show in the way a statusbar do, but unfortunately, it did not despite the xml already stated it. I dnn't know if it is due to some unknown deficiency of my odoo installation.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
5324
1
أبريل 22
6494
1
مايو 21
7388
1
يناير 21
5257
1
مايو 20
7113