我在尝试在我的视图上显示字段字符串时遇到问题,我正在尝试将两个字段添加到我的视图的页脚中,并且字段显示,但不显示字符串。这是我的观点:
<record id="book_contract_form" model="ir.ui.view">
<field name="name">worksheet.form</field>
<field name="model">mrp.worksheet.contract</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Contract Worksheet form">
<header>
<div class="oe_title">
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
</header>
<sheet string="Contract Worksheet">
<group >
<group>
<field name="date"/>
<field name="book_block"/>
</group>
</group>
<notebook>
<page string="Specification - Description">
<group>
<group string="Paper for Text">
<group>
<field name="wt"/>
</group>
</group>
<group string="Paper for Text">
<group>
<field name="gsm_sheet"/>
</group>
</group>
<group string="Paper for Cover">
<group>
<field name="gsm_cover"/>
</group>
</group>
</group>
</page>
<page string="Production Estimate - Printing">
<group>
<group string="Types">
<group>
<field name="printing_text_type"/>
</group>
</group>
</page>
<page string="ISBNS">
<field name="isbns" colspan="4" nolabel="1" >
<tree string="ISBNS" editable="bottom" create="false">
<field name="name"/>
</tree>
</field>
</page>
<page string="Production Estimate/Binding" attrs="{'invisible': [('additional_job', '!=', True)]}">
<group>
<group string="Lamination/Packeting">
<field name="cost_rs18" />
</group>
<group string="Packing">
<field name="cost_rs19" />
</group>
<group string="Other">
<field name="cost_rs20" />
</group>
<group string="Total">
<field name="total_totals" />
</group>
</group>
</page>
</notebook>
<div class="footer">
<field name="due_date" string="Due Date"/>
<field name="total_totals" string="Total" />
</div>
</sheet>
</form>
</field>
</record>
正如您所看到的,我甚至将string
标志放在视图上,它们也在.py文件上有这些字符串,但它们也不会出现。
有什么想法吗?
答案 0 :(得分:2)
如果用字符串表示标签,则应将字段放在一个组中。
<div class="footer">
<group>
<field name="due_date" string="Due Date"/>
<field name="total_totals" string="Total" />
</group>
</div>
或者添加 标签
<div class="footer">
<label for="due_date"/>
<field name="due_date" string="Due Date"/>
<label for="total_totals"/>
<field name="total_totals" string="Total" />
</div>
答案 1 :(得分:1)
这可能是由于您使用过:<div class="footer">
使用&#34; <footer>
&#34;标签是这样的。可能会起作用..