Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Customize one2many relational field in Odoo

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.26k
    Comment on it

    If you want to customize one2many relational filed in Odoo. Then you have to go in .py file of that module then go to .xml file. For example see below code.

    In xml you would have wrote code like this :

     

    <field name="test" widget="one2many_list" colspan="4" nolabel="1">
    <tree string="Details">
          <field name="field1" />
          <field name="field2" />
              ---------------------------------------------
          <field name="designation" /> 
        </tree>                          
    </field>
    
    //Add form section inside and mention all the fields you needed, as follow :
    
    <field name="test" widget="one2many_list" colspan="4" nolabel="1">
    <tree string="Details">
          <field name="field1" />
          <field name="field2" />
              ---------------------------------------------
          <field name="designation" /> 
        </tree> 
        <form string="Details" editable="bottom">
          <field name="field1" />
          <field name="field2" />
              ---------------------------------------------
          <field name="designation" /> 
        </form>                      
    </field>
    
    
    

     Note- In Many2one fields you have to Add form section inside and mention all the fields you needed.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: