如何更改Odoo中关系字段的显示值
来源:互联网 发布:php调用百度日历api 编辑:程序博客网 时间:2024/05/18 03:17
How to change displayed value for relational field in Odoo
If you want to change the displayed value for a relational field in Odoo, the simplest way to do that is to define the “_rec_name” model’s attribute with the name of the field that you want to show.
For example, if you want to add new field “description” in the hr.employee.category model and you want that field to be shown as value for this model the code should look like:
class Employee(models.Model): _inherit = 'hr.employee.category' _rec_name = 'description' description = fields.Char()
Now when you try to search for a new employee tag in the hr.employee view it will search by and display the description of the hr.employee.category model.
简而言之,简单的改变关系字段的显示,只需要将对应关系字段的model中_rec_name修改成需要显示的字段即可,这样之后的字段显示就是该字段的值。
From:http://www.odooninja.com/change-displayed-value-relational-field-odoo/
阅读全文
0 0
- 如何更改Odoo中关系字段的显示值
- odoo(Openerp)如何在字段的on_change方法中动态返回domain
- odoo关系型字段domain写法
- 【小小问题集合2---SQL Server中如何更改或删除字段的Default值】
- 小小问题集合2---SQL Server中如何更改或删除字段的Default值
- odoo字段定义的参数
- 如何更改表的字段名?
- 如何更改数据表主键字段的数据类型
- 更改字符字段的值
- SQLServer中如何将一个字段的多个记录值合在一行显示
- SQL Server中如何将一个字段的多个记录值合成一起显示
- oracle中将三个没有关系的表的字段再同一个表中显示 union all
- 如何更改主框架的显示
- 更改powerdesigner的关系Notation的显示方式方法
- odoo系统中如何导入/导出数据?
- 更改主外键关联的字段值
- 如何修改RubyOnRails中ActiveRecord默认的表格名和外键字段映射关系?
- hive查询如何显示查询的字段
- java泛型中<?>和<T>有什么区别?(转)
- 教你怎么使用pdf阅读器,怎么删除书签
- vcpkg安装指南
- 一天一点新知识_SpringMVC中session的获取和操作
- ubuntu kylin16.04安装jdk1.8
- 如何更改Odoo中关系字段的显示值
- 压测工具 Gatling
- 分布式消息Kafka
- Android-adb常用命令
- 对于状态栏的一种解决
- 产品之术:见人说人话,PRD的五种形态
- 系统测试与集成测试的区别
- (一个坑)关于ViewPager滑动监听的一只
- vue路由 遍历生成复数router-link