在 Odoo 视图中将字段输出为文本



直接提问。 我们可以只在Odoo视图中将字段输出为文本吗?

<record id="view_of_a_model" model="ir.ui.view">
<field name="name">the_name_of_the_view</field>
<field name="model">a.beautiful.model</field>
<field name="arch" type="xml">
<form>
<sheet>
How to output fields as text here?
</sheet>
</form>
</field>
</record>

我想添加更多解释。我想要的是这样的...

<a href="http://localhost/DSLNG/dbo_View_PatientVisit_list.php?qs=??????put the field as text here??????" target="_blank">Open record in other application</a>

很抱歉造成混淆

PS :似乎人们认为使用字段标签是要走的路。但是使用字段标签会在编辑模式下将字段显示为输入。我想要的是将其显示为文本,而不管当前的视图模式如何。

odoo 视图中的文本

蟒蛇代码:

notes = fields.Text(string='Notes') 

XML 视图:

<record id="view_of_a_model" model="ir.ui.view">
<field name="name">the_name_of_the_view</field>
<field name="model">a.beautiful.model</field>
<field name="arch" type="xml">
<form>
<sheet>
<i>notes</i> ===> Text here 
<field name="notes" />
</sheet>
</form>
</field>
</record>

最新更新