当前位置:网站首页>odoo14 | 关于状态栏statusbar关键词使用后显示异常及解决方法
odoo14 | 关于状态栏statusbar关键词使用后显示异常及解决方法
2022-07-25 05:16:00 【代码总是有bug】
今天遇到一个有意思的bug,我跟着odoo14开发手册敲代码,由于教材的教学结构是按功能写的,前后代码描述上有出入,发生了一些冲突,今天遇到的则是根据state字段出状态栏的bug
这是我的字段
state = fields.Selection(
[('draft', '不可用'),
('available', '可用'),
('borrowed', '已借出'),
('lost', '已丢失')], u'状态', default='draft')如下图所示

<header>
....这里是按钮部分的代码故省略
<field name="state" widget="statusbar"/>
</header>这里之所以会变成这个样子,这并不是这一代码写错了
而是我在之前的章节中,在form视图中的下半段也写了一个state字段的显示
.......上面是form视图的上半部分
<group>
<group>
<field name="name"/>
<field name="author_ids" widget="many2many_tags"/>
-> <field name="state"/> <- 没错,就是这一行
<field name="pages"/>
<field name="age_days"/>
<field name="publisher_id"/>
<field name="publisher_city"/>
<field name="notes"/>
</group>
.........将其注释掉或删除后,安装或升级模块

现在状态栏就可以正常显示了
解析:state的普通字段不注释会与状态栏发生不报错冲突,状态栏会被当作普通枚举字段显示
边栏推荐
- 教你三招从让性能从20s优化到500ms
- 微信小程序相关操作示例
- 使用getifaddrs获取本机网口IP地址
- STL notes (VII): container deque
- 1310_一个printf的实现分析
- The 6th "Blue Hat Cup" National College Students' Cyber Security Skills Competition writeup
- Baklib: share some methods about building enterprise knowledge management (km)
- Learn to use PHP to get the URL address link after resetting
- 956. Highest billboard pressure DP
- Solve the problem that uni app applet obtains routes and route parameters
猜你喜欢

Special analysis of data security construction in banking industry

Event cycle mechanism browser nodejs async await execution sequence promise execution sequence interview questions
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

Solution of win11 blue screen code 0x0000001a

Implement is by yourself_ convertible

2022-7-18 summary

STL notes (IV): String

小红书携手HMS Core,畅玩高清视界,种草美好生活

How to publish your own NPM package

Basic knowledge of scratch crawler framework
随机推荐
微信小程序相关操作示例
Forwarding and sharing function of wechat applet
Implement is by yourself_ base_ of
Project management tools - project developer tools
DOM在Ahooks中的处理过程
1310_一个printf的实现分析
Render Optimization: repaint and reflow
300. Longest increasing subsequence
Performance Optimization: how to solve the slow loading speed of the first screen of spa single page application?
[live review] AI customer service "changes according to the situation", and man-machine dialogue can be easier
Solution of win11 blue screen code 0x0000001a
H5 new feature domcontentloaded event - custom attribute -async attribute -history interface method - local storage -postmessage
85 distributed project construction
Androd releases jitpack open source project (gradle7.2)
Event cycle mechanism browser nodejs async await execution sequence promise execution sequence interview questions
STM32 Development Notes 118: using CMSIS DSP Library in stm32cube IDE
Wechat official account all article download links to get
[wechat applet] label (86/100)
Information System Project Manager --- Chapter IX examination questions of project human resource management over the years
深圳随到随考,科目四随到随考,科三理论第二理论随到随考说明