答案 0 :(得分:0)
这是解决方案。
<record id="product_normal_form_view_inherit" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page[@string='Information']/group/group/field[@name='list_price']" position="after">
<field name="country_id"/>
</xpath>
</field>
</record>
答案 1 :(得分:0)
继承product.template
。
您的xml
文件应为:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="product_template_product_form_inherited" model="ir.ui.view">
<field name="name">product.template.product.form.inherited</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="//page[@string='Information']/group/group" position="inside">
<field name='country_id'/>
</xpath>
</field>
</record>
</data>
</openerp>
python
档案:
from openerp import models, fields
class product_template(models.Model):
_inherit = 'product.template'
country_id = fields.Many2one('res.country', 'Country')