odoo 字段后面添加button按钮,页签tree再加group显示字段

odoo 字段后面添加button按钮,页签tree再加group显示字段

字段后面添加button按钮

代码:

<field name="customs" position="replace">
    <label for="customs"/>
    <div>
        <field name="customs" string="船运提单号" nolabel='1'/>
        <button name="cargo_ship_select" string="船运信息查询" type="object" class="btn-primary"
                style='margin-left: 30px'/>
    </div>
</field>

效果:

页签tree再加group显示字段

代码:

<notebook class="tax-add-notebook" attrs="{'invisible': [('state', '!=', 'done')]}">
    <page class="tax-add-page" string="补税信息">
        <group>
            <div>
                <label for="customs_add_declaration"/>
                <field name="customs_add_declaration"
                       string="税单号"/>
            </div>
            <div>
                <label for="bill_add_date"/>
                <field name="bill_add_date"
                       string="税日期"/>
            </div>
        </group>
        <button name="generate_various_orders" 
                string="xxxx" 
                type="object"
                class="oe_highlight oe_read_only" 
                style="float: right"/>
        <field name="bill_tax_add_ids">
            <tree string="补税单明细行" editable="bottom">
                <field name="product_id" string="品名"/>
            </tree>
        </field>
    </page>
</notebook>

效果:

原文地址:https://www.cnblogs.com/pywjh/p/14072989.html