I was working on one2many relational field to integration one functionality. Worked on python code and then wrote an xml file for the same. Restarted my server. It showed me the row with headers and 'Add an item' button. When clicked on that it opened a pop-up to provide inputs. It shows all the fields with in sequence of it's own.
Q1. I need input fields in other sequence or don't need all fields.
A. In xml you would have wrote code like this :
<field name="dirtyhandsphp" 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="dirtyhandsphp" 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>
Q2. Fields are few so want to edit at the same place. No separate pop-up.
A. Add editable attribute to tree tag as follow
<tree string="Details" editable="bottom">
or
<tree string="Details" editable="top">
Thanks!!!!!!!! Enjoy Programming:)
Q1. I need input fields in other sequence or don't need all fields.
A. In xml you would have wrote code like this :
<field name="dirtyhandsphp" 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="dirtyhandsphp" 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>
Q2. Fields are few so want to edit at the same place. No separate pop-up.
A. Add editable attribute to tree tag as follow
<tree string="Details" editable="bottom">
or
<tree string="Details" editable="top">
Thanks!!!!!!!! Enjoy Programming:)
Comments
Post a Comment
Thanks for your valuable comments.