From b4b373c965fef224f95356a3ca332d3d37f93383 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Sun, 9 Aug 2015 22:02:56 +0100 Subject: [PATCH] [IMP] doc: better xpath example The xpath syntax `"//selector` is mostly used in Odoo, is clearer on the meaning and more flexible about view changes. Give an example with the mostly used syntax. Add a tip to indicate the shorter xpath syntax --- doc/howtos/backend.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index 5ed3c622818..061e9fbc577 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -626,9 +626,9 @@ instead of a single view its ``arch`` field is composed of any number of idea.category - - + @@ -652,6 +652,22 @@ instead of a single view its ``arch`` field is composed of any number of alters the attributes of the matched element using special ``attribute`` elements in the ``xpath``'s body +.. tip:: + + When matching a single element, the ``position`` attribute can be set directly + on the element to be found. Both inheritances below will give the same result. + + .. code-block:: xml + + + + + + + + + + .. exercise:: Alter existing content * Using model inheritance, modify the existing *Partner* model to add an