This bug is still valid, the bug appear only if the selected field is the last of its own stack !!!
:
res.partner.category.form.partner
res.partner.category
it leads to this from a server answer to a view ask (in the DEBUG_RPC log):
Indeed in code (server/bin/osv/orm.py @ line 1261):
else:
sib = node.getnext()
for child in node2:
if pos == 'inside':
node.append(child)
elif pos == 'after':
if sib is None:
node.addnext(child)
else:
sib.addprevious(child)
elif pos == 'before':
node.addprevious(child)
else:
raise AttributeError(_('Unknown position in inherited view %s !') % pos)
Our nodes are like this (DOM):
+ name
+ active
+ parent_id (the "node" var in code)
The actual code will do this:
1.
* sib = None (the node is the last of its stack)
* add after "node"
* result DOM:
+ name
+ active
+ parent_id
+ newline
2.
* sib = "newline node"
* add BEFORE "newline node"
* result DOM:
+ name
+ active
+ parent_id
+ separator
+ newline
3.
* sib = "separator node"
* add BEFORE "separator node"
* result DOM:
+ name
+ active
+ parent_id
+ partner_ids
+ separator
+ newline
The patch to correct this is the following one (server/bin/osv/orm.py @ line 1261) :
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:
raise AttributeError(_('Unknown position in inherited view %s !') % pos)
This is simpler and work as expected in all cases !