2
我添加了一個新的領域進入product_uom_categ
模型,通過繼承這樣的:添加繼承場到樹視圖product_uom_categ - Odoo V9
class product_uom_categ(models.Model):
_inherit = 'product.uom.categ'
code_product = fields.Char(string="Código Unidad")
在我看來
然後:
<openerp>
<data>
<record id="product_uom_categ_form_view" model="ir.ui.view">
<field name="name">product.uom.categ.form</field>
<field name="model">product.uom.categ</field>
<field name="inherit_id" ref="product.product_uom_categ_form_view" />
<field name="arch" type="xml">
<field name='name' position="after">
<field name="code_product"/>
</field>
</field>
</record>
</data>
</openerp>
它工作正常,儘管我想在該定義的樹視圖中看到這一點,但我找不到一種方法來實現它,例如,在原始視圖模型中,實際上並沒有定義樹視圖,而只是一個像這個:
<record id="product_uom_categ_form_view" model="ir.ui.view">
<field name="name">product.uom.categ.form</field>
<field name="model">product.uom.categ</field>
<field name="arch" type="xml">
<form string="Units of Measure categories">
<group>
<field name="name"/>
</group>
</form>
</field>
</record>
<record id="product_uom_categ_form_action" model="ir.actions.act_window">
<field name="name">Unit of Measure Categories</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.uom.categ</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new unit of measure category.
</p><p>
Units of measure belonging to the same category can be
converted between each others. For example, in the category
<i>'Time'</i>, you will have the following units of measure:
Hours, Days.
</p>
</field>
</record>
因此,在form
它顯示了這兩個領域,name
和我的新領域code_product
,但樹視圖中,並沒有什麼,但也沒有什麼這方面的繼承,我應該繼承的行動?
我被困在這個,任何想法?
超級棒!非常感謝你!奇蹟般有效 :-) – NeoVe