我想創建一個模塊,存儲一個夥伴的多個地址。我的問題是與視圖部分,只有城市領域是可見的形式其他領域是不可見的,當單擊「添加項目」時,地址字段是隨機序列像郵政編碼先來,然後街道等。openerp one2many問題與視圖
請建議如何繼續以便所有字段都可見?
class extendcustomersaddress(orm.Model):
_name="res.partner"
_inherit = 'res.partner'
_columns =
{
'extraaddress':fields.one2many('seq.address','x_client_id','Address')
}
extendcustomersaddress()
class related_address(orm.Model):
_name="seq.address"
_columns =
{
'x_street' : fields.char('Street', size=170),
'x_street1' : fields.char('Street1', size=170),
'x_city' : fields.char('City', size=170),
'x_state' : fields.char('state', size=170),
'x_zip' : fields.char('Zip code', size=10),
'x_country' : fields.many2one('res.country', 'Country'),
'x_client_id': fields.many2one('res.partner', 'id',invisible=True)
}
related_address()
<openerp>
<data>
<record model="ir.ui.view" id="namelist_dailyupdate">
<field name="name">res.partner.form</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Email">
<separator string="Additional Emails" colspan="4"/>
<tree name="abcd" editable="Bottom">
<field name="extraaddress" />
</tree>
</page>
</notebook>
</field>
</record>
</data>
</openerp>
非常感謝曼西,它的工作原理。 – Vaibhav