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

I create a status bar for a model but view field does not load properly. (odoo v12)

the below code only shows the text of the current set status. But with the same set of code i'm able to load all the status properly in a different model.

i'm unable to paste the image here, to show the actual result. need help for that too.

python: 

status = fields.Selection([
('draft', 'Draft'),
('posted', 'Posted'),
('active', 'Active'),
('closed', 'Closed'),],string='Status Type', required = True,default = 'draft')

xml:

<field name="status" widget="statusbar" options="{'fold_field': 'fold'}" readonly="1"/>
الصورة الرمزية
إهمال

Did you add the field in the header ?

الكاتب

Yes i did

أفضل إجابة

Please use below code-

<field name="status" widget="statusbar"/>
options="{'fold_field': 'fold'}" is used in many2one staus fileds.


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
مايو 24
7013
1
يوليو 23
2268
3
يونيو 23
3106
4
يونيو 22
4781
3
أبريل 22
5393