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.

0

How to understand view name and model data anywhere in Odoo?

By
Pascal Tremblay
on 3/21/15, 9:47 AM 1,359 views

Hello all,

Since many months, I want to ask you about this.

My goal : I want to understand deeply how « View Name » and « Model Data » works in view definitions.

Here is a situation/example to understand

When we are in account.invoice, there is 4 different views : tree, form, calendar and graph.


There is one controller (action) :

  • name : Sales Invoices (external ID : custom_module.action_invoice_tree1)



These four views have respectively 4 names and 4 external ID :

  • name : account.invoice.tree (external ID : account.invoice_tree)

  • name : account.invoice.form (external ID : account.invoice_form)

  • name : account.invoice.calendar (external ID : account.view_invoice_line_calendar)

  • name : account.invoice.graph (external ID : account.view_invoice_graph)

When I edit one of this four views, I have this :



Questions :

  1. In the controller, at the bottom, there is only two views (tree and form). Where are calendar and graph? Don't need it there?

  2. In view definition, I see that « View Name » is always written with dot « account.invoice.graph » instead of words without dot « Account invoices graph ». Why?

  3. I see that » Model Data » is always equal to « View Name ». Why?

  4. Unable to find the documentation to answer my questions. Where it is?

I feel like I don't understand something with these kind of views...

Thanks

0

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2993
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/21/15, 2:12 PM

hello


1. Odoo generate default view, you need to specify an arch only if you want to change the default view (usability).

2. It's a convention, but it's not compulsory... 

3. Because the display name from an xml id, is the name from the object pointed by this data. So it will be always the current object in this case. (model data showed in the model view)

4. Reading doc, Reading existing code, searching on web, asking in forum, ... 



I will analyze each of your words. Thanks a lot for your answers.

Pascal Tremblay
on 3/21/15, 3:16 PM

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)

Stats

Asked: 3/21/15, 9:47 AM
Seen: 1359 times
Last updated: 3/21/15, 2:12 PM