[IMP] make mode handling more regular
authorXavier Morel <xmo@openerp.com>
Tue, 27 May 2014 10:23:02 +0000 (12:23 +0200)
committerXavier Morel <xmo@openerp.com>
Tue, 27 May 2014 10:23:02 +0000 (12:23 +0200)
commitab7dd577711e2394e6ce6df4497140351dbd0792
tree2a7c6026dec40cf7a4f3d90e41147670bfa3dffb
parent0f5424eac4a337a3a1a3e1e5876fa26a3fffb1ed
[IMP] make mode handling more regular

Before this commit, @mode=primary would be sorta-ignored[0] if the current
view and its parent had the same model: the current view would *still* get
applied (as an extension) when asking OpenERP for its parent. This commit
makes mode=primary views behave regularly, they are *never* applied when
asking for their parent, only when asking for them or their children.

This allows "forking" views, and using extended views in some contexts without
breaking or duplicating the original view

[0] there was actually a problem when asking for the current view directly,
    first its parent would be resolved by applying it, then it would be
    applied to resolve itself, the view would thus get applied twice (oops)
openerp/addons/base/ir/ir_ui_view.py
openerp/addons/base/tests/test_views.py