Home > DeveloperSection > Forums > How to move a field to other position in a OpenERP7 form view?
john rob

Total Post:108

Points:756
Posted on    November-06-2014 3:30 AM

 XML XML Parsing 
Ratings:


 1 Reply(s)
 741  View(s)
Rate this:

I made a form view in OpenERP7, which inherits from an existing form view.

I am trying to move some field to other position, only moving, because I need to preserve its functionality.

Easy example: let's suppose that the name of the field I want to move is field_to_move, and I want to move it just after the field called above_field. I tried the next code:

<xpath expr="/form//field[@name='field_to_move']" position="replace">
    <xpath expr="/form//field[@name='above_field']" position="after">
        <field name="field_to_move" on_change="onchange_type(field_to_move)" />
    </xpath>
</xpath>

The result is wrong, I am generating the new field in a wrong position (the same before the changes) and the old field is still visible, so it is duplicated.



Samuel Fernandes
Samuel Fernandes

Total Post:156

Points:1096
Posted on    November-06-2014 6:25 AM

Try this, it will work

  1. Hide the current position of field.

    <field name="field_to_move" position="attributes">
        <attribute name="invisible">1</attribute>
    </field>
  2. Move to desire place using below code.

    <field name='above_field' position="after">
        <field name="field_to_move"/>
    </field>

Hope this will help you.


Don't want to miss updates? Please click the below button!

Follow MindStick