Odoo Help

Welcome!

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.

2

Reusing Odoo views via API?

By
Rick
on 7/22/14, 8:42 AM 901 views

Hi all, 

Is it possible to use the Odoo views in my own front-end framework? i'm not reffering to the static Javascript api, i just want to use precompiled Odoo templates. 

I've tried to figure out how the template parser works, but no luck. I know the parsing is done by QWeb and I found the function "instance.web.fields_view_get" in /addons/web/static/src/js/views.js but there's nothing to find about this on https://doc.odoo.com. 

For example: I want to use the template "Product.template.product.kanban", so i do an RPC API call to http://myodooserver:8069/web/dataset/call_kw/product.template/fields_view_get. In the reponse i find "arch" wich contains a XML string. Then Odoo makes a call to http://myodooserver:8069/web/dataset/search_read. There i find records with data for example the "service" product: 

  • virtual_available: 0
  • name: "Service"
  • product_variant_ids: [1]
  • is_product_variant: true
  • __last_update: "2014-07-08 08:26:39"
  • image_small: null
  • uom_id: [5, "Hour(s)"]
  • lst_price: 75
  • qty_available: 0
  • type: "service"
  • id: 1
  • product_variant_count: 1

Wich file or function in /addons/web/static/src/js/ handles this respons and renders the XML template to HTML ? And is it possible to use this precessed HTML in my own web-application? 

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

1 follower(s)

Stats

Asked: 7/22/14, 8:42 AM
Seen: 901 times
Last updated: 3/16/15, 8:10 AM