Odoo Help

0

Qweb Xpath of child node

By
Jo
on 2/1/16, 1:12 AM 921 views

Hi all,

Here i want insert a <li> item inside existing <ul>.

I tried this,

XML

<ul id="top_menu">
    <li><a>1</a></li>
    <li><a>2</a></li>
    <li><a>3</a></li>
</ul>
XPATH

  <xpath expr="//ul[@id='top_menu']/li[1]" position="after">
     <li><a>100</a></li>
  </xpath>
I got my new item "100" at last item of <ul>. but i need it in after 1 item.

Thanks in advance..

You could also use "//ul" position="inside"

Yenthe
on 2/1/16, 1:50 AM
0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
3168
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 2/1/16, 4:12 AM

I've tested your code, and it works fine with me. As expected ....

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/1/16, 1:12 AM
Seen: 921 times
Last updated: 2/1/16, 4:12 AM