跳至內容
選單
此問題已被標幟
1 回覆
6420 瀏覽次數

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
5月 24
7150
1
7月 23
2299
3
6月 23
3189
4
6月 22
4904
3
4月 22
5477