如何在div中正确继承字段

时间:2017-10-30 20:03:18

标签: openerp odoo-8 odoo-9 odoo-10 odoo-view

如何正确继承字段 我继承了一个字段,但没有按要求显示,因为它在div

<group name="email_template_and_project" position="before">
    <group name="sale_condition" string="Sale Conditions">
        <label for="warranty" groups="stock.group_production_lot"/>
        <div groups="stock.group_production_lot">
            <field name="warranty" class="oe_inline"/> months
        </div>
        <label for="sale_delay"/>
        <div>
            <field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
        </div>
    </group>
</group>
<record model="ir.ui.view" id="view_product_template_es_">
    <field name="name">product.template.es.form</field>
    <field name="model">product.template</field>
    <field name="inherit_id" ref="product.product_template_only_form_view"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='sale_delay']" position="after">
            <div>
                <field name = 'time_pose' /> hours
            </div>
        </xpath>
    </field>
</record>

field add

1 个答案:

答案 0 :(得分:1)

<record model="ir.ui.view" id="view_product_template_es_">
    <field name="model">product.template</field>
    <field name="inherit_id" ref="product.product_template_only_form_view"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='sale_delay']/parent::div" position="after">
            <label for="time_pose"/>
            <div>
                <field name="time_pose" class="oe_inline"/> hours
            </div>
        </xpath>
    </field>
</record>