当前位置:网站首页>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的普通字段不注释会与状态栏发生不报错冲突,状态栏会被当作普通枚举字段显示
边栏推荐
- Basic knowledge of scratch crawler framework
- Redis集群搭建(Windows)
- Unity LOD
- DOM在Ahooks中的处理过程
- Sword finger offer II 012. the sum of the left and right subarrays is equal
- 85 distributed project construction
- [live review] AI customer service "changes according to the situation", and man-machine dialogue can be easier
- rhce第一天
- STL notes (III): input / output stream
- The 6th "Blue Hat Cup" National College Students' Cyber Security Skills Competition writeup
猜你喜欢
[email protected] R & D effectiveness measurement indicators"/>Learning records [email protected] R & D effectiveness measurement indicators

龙蜥社区发布首个 Anolis OS 安全指南 为用户业务系统保驾护航

2022-7-13 summary

rhcsa暑假第三天

I will write some Q & A blogs recently, mainly focusing on the points that are easy to have doubts.

Leetcode55. Jumping game

项目管理工具——项目开发者工具

Three must know and know problems of redis

Unity LOD
![[globally unique ID] how to handle the ID primary key after dividing the database and table?](/img/a1/800ee868b74ce5d98956d4a0e2c075.png)
[globally unique ID] how to handle the ID primary key after dividing the database and table?
随机推荐
Solution of win11 blue screen code 0x0000001a
Add click event to unity 3D object
Set up private CA server
Event cycle mechanism browser nodejs async await execution sequence promise execution sequence interview questions
教你三招从让性能从20s优化到500ms
An article takes you to understand the sentinel mode of redis
Blog Description & message board
STL notes (IV): String
教你如何定位不合理的SQL?并优化之
Dragon Dragon community released the first Anolis OS Security Guide to escort users' business systems
Getting started with scratch
Teach you how to locate unreasonable SQL? And optimize it
Bypass XSS filters in Web Applications
The third question of force deduction -- the longest substring without repeated characters
Which side of Nacos has the SQL script of this column?
STL notes (VII): container deque
自己实现is_class
深圳随到随考,科目四随到随考,科三理论第二理论随到随考说明
epoll的实现原理
[untitled]