how to customize a field of 'one2many' type in view?

Asked by Cuong

Hi,

In the case of one2many fields, how can I control what fields to display to users?

For example, one partner (res_partner) has many addresses (res_partner_address). Now in partner view, I want to display only name, street, phone information. How can I do this?

Thanks,

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Riken Bhorania (OpenERP)
Solved:
Last query:
Last reply:
Revision history for this message
Best Riken Bhorania (OpenERP) (rch-openerp) said :
#1

Hello Cuong,

You can customize o2m field on Form view in order to restrict the number of fields that you want to display on Form as well Tree view of that corresponding o2m field.

As for example, you can do such customization by defining o2m field "partner_address_ids" in form view as below:

       <field name="partner_address_ids" nolabel="1">
             <form string="Address">
                 <field name="name"/>
   <field name="street"/>
   <field name="phone"/>
             </form>
             <tree string="Address">
                 <field name="name"/>
   <field name="street"/>
   <field name="phone"/>
              </tree>
        </field>

Hope this will help you.

Revision history for this message
Cuong (bhcuong2008) said :
#2

Thanks Riken Bhorania (Open ERP), that solved my question.