Skip to Content
Menu
This question has been flagged
2 Replies
4309 Views

This is my python code:

class Residents(models.Model):
    _inherit = "res.partner"
    _name = "residents.details"

    f_no = fields.Char()
    id_proof = fields.Selection([('aadhar_card','Aadhar Card')],string = "Id Proof")
    id_no = fields.Char(string = "Id no")

xml code:


<record id = "add_field_view_partner_form" model = "ir.ui.view">
        <field name = "name">add.fields</field>
        <field name = "model">residents.details</field>
        <field name = "inherit_id" ref = "base.view_partner_form"/>
        <field name = "arch" type = "xml">
            <field name = "city" position="before">
               <field name = "f_no" placeholder = "Flat No"/>
            </field>
            <field name = "lang" position="after">
               <field name = "id_proof" />
            </field>
            <field name = "id_proof" position="after">
                <field name = "id_no" />
            </field>
        </field>
    </record>



Avatar
Discard

the fields should be grouped.

Best Answer

Hi Sibi,

<record id = "add_field_view_partner_form" model = "ir.ui.view">
       <field name = "name">add.fields</field>
       <field name = "model">residents.details</field>
       <field name = "inherit_id" ref = "base.view_partner_form"/>

                <field name = "arch" type = "xml">

                    <xpath expr='//field[@name="street2"]' position='after'>

                       <field name = "f_no" placeholder = "Flat No"/>

                    </xpath>

                    <xpath expr='//field[@name="lang"]' position='after'>

                        <field name = "id_proof" />

                        <field name = "id_no" />

                    </xpath>

                </field>

 </record>


               try this, 

              

              

                

Avatar
Discard
Related Posts Replies Views Activity
0
Sep 23
497
0
Sep 23
450
2
Feb 23
9253
6
Oct 23
19272
3
Mar 24
7688