Odoo Help

0

one2many issue with view

By
vaibhav sharma
on 1/27/14, 1:07 AM 1,434 views

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>

2
Silviaa
On 1/27/14, 3:51 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/27/14, 1:07 AM
Seen: 1434 times
Last updated: 3/16/15, 8:10 AM