← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 455547] Re: Using position="after" in inherited view adds the fields in reverse order

 

This bug has been duplicated and is fixed in trunk by using your patch.
https://bugs.launchpad.net/openobject-server/+bug/686275

http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/3097
Revision ID: odo@xxxxxxxxxxx-20101211012104-gt1cg3z1ec91mg34

But some code is useless now... like I already told (the "sib" thing) the follow code is enough:
                     else:
                         for child in node2:
                             if pos == 'inside':
                                 node.append(child)
                             elif pos == 'after':
                                 node.addnext(child)
                                 node = child
                             elif pos == 'before':
                                 node.addprevious(child)
                             else:

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/455547

Title:
  Using position="after" in inherited view adds the fields in reverse order

Status in OpenObject Server:
  In Progress
Status in OpenObject Server 5.0 series:
  In Progress
Status in OpenObject Server trunk series:
  In Progress

Bug description:
  Applies to 5.0.6

For example, if I use the following 'arch' XML in an inherited view:

            <field name="arch" type="xml">
                <field name="my_field" position="after">
                    <field name="field1" />
                    <field name="field2" />
                    <field name="field3" />
                    <field name="field4" />
                </field>
            </field>

The resulting screen will display the fields in the following order:

my_field
field4
field3
field2
field1

My guess is that the server is calling the 'insert after' xml method for each sub-tag in order.

The fix will be to call the 'insert after' xml method for each of the sub-tags in reverse order, so that field1 is inserted last, so it appears directly after my_field

I will use the position="replace" method as a workaround for now.