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