Odoo Help

Welcome!

This community 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.

0

one2many issue with view

By
vaibhav sharma
on 1/27/14, 1:07 AM 999 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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