用 position="replace" 代替父视图相关定义,就可以在父视图调用子类的方法 <xpath expr="//field[@name='standard_price']" position="replace"> <group name='cost_prices' colspan="2" col="4"> <field name="standard_price" nolabel="1" attrs="{'readonly':[('cost_method','=','average')]}"/> <field name="cost_price_extra" groups="product.group_product_variant"/> </group> </xpath> <xpath expr="//button[@name='open_ui']" position="replace"> <button name="open_ui" type="object" string="Start Selling" attrs="{'invisible' : [('pos_state', 'not in', ('opened',))]}" class="oe_highlight" invisible="True"/> </xpath>