简体   繁体   English

更改 Odoo 中自动生成的表单视图的标题

[英]Change title of automatically generated form view in Odoo

I want to change the heading of form view in the grey area.我想更改灰色区域中表单视图的标题。 (Check image below.) (检查下图。)

This should have to be changed from SHIP00001 to some other name or field.这应该必须从 SHIP00001 更改为某个其他名称或字段。 Is that possible?这可能吗?

示例

The name in the form view is gotten in two ways表单视图中的名称有两种获取方式

  1. From a field which you specified name of the field (ie name = fields.Char('Field name') )从您指定字段name的字段(即name = fields.Char('Field name')
  2. and when you set _rec_name to some other field or you override _name_get to set a custom name当您将_rec_name设置为其他字段或覆盖_name_get以设置自定义名称时

so what you can simply do is set所以你可以简单地做的是设置

_rec_name to another field in your model _rec_name到模型中的另一个字段

That's the name that will show up the form heading or in the drop down field of any other model where you have a relation to it.该名称将显示在表单标题或与您有关系的任何其他模型的下拉字段中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM