Odoo Help


This community 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.


XPath Check if element exist

Jeferson M. Moreira
on 8/2/16, 6:06 AM 270 views

I'd like to know if someone have an ideia how I can check if an element exists in a template that inherits or calls other one.

Actually, if an element doesn't exist, you will get error log when upgrading module.

Kera Sakti
on 8/3/16, 3:22 AM

Axel Mendoza

--Axel Mendoza--
| 6 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 8/2/16, 11:59 PM

As long as I know there is none about that in Odoo but it's not difficult to get it done developing a new QWeb tag to check that. You just need to be aware of where do you need to check, in the local template you supposedly are not on the top and if you wanna check from the top you need to get the same template name/id from the qwebcontext, on another template you need to pass the template name/id to the tag call so you could get the arch to check the xpath expressions. The result could be set into qwebcontext or maybe will be even helpful to set it to qwebcontext and instead evaluate the tag body of the new tag. This are just dropped ideas

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 8/2/16, 6:06 AM
Seen: 270 times
Last updated: 8/3/16, 1:43 PM