Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4735 มุมมอง

i am trying to create a module that stores multiple address of a partner. My issue is with view part, only city field is visible in form other fields are not visible, when "add an item" is clicked, the address fields are coming in random sequence like zipcode comes first, then street etc.

Kindly suggest how to proceed so that all fields are visible?

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>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can try this. Make your customer address fields inside a tree.

  <separator string="Additional Emails" colspan="4"/>
       <field name="extraaddress">
           <tree string="Extra Address" editable="bottom">
               <field name="x_street"/>
               <field name="x_street1"/>
           </tree>
       </field>

Hope it will help

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 18
4350
7
ส.ค. 25
34437
4
ธ.ค. 23
17876
1
ก.ย. 16
7557
0
มี.ค. 15
3780