Skip to Content
Menu
This question has been flagged
1 Reply
1637 Views

It seems, that context content updating after fields_view_get-method invoke. This is problem. When I open my module view int the Odoo, first it is empty, but when I refresh the browser, then there is data in the view. Data comes from fields_view_get-method. This method run sql script and makes html nodes. One parameter in the sql script comes from the context. Odoo main design pattern is MVC and this is problem with realtional databases, because it is too strict for dynamic views. One view belongs to one database table. You have problem when you trying to make user interface where is for example some kind of data table where is data from many models and user can customize is. Odoo pivot table can resolve this problem but it can do this only when you have data groups what you can show in the "pivot mode".

I think that Odoo needs some design pattern who supports dynamic views. MVC pattern is not enought.


Avatar
Discard
Author Best Answer

I made other kind of solution.

In the model:
your_field = fields.Html( 'Your field', compute='_your_method_it_using_sql' )

In the view:
field name="your_field" readonly="1"

So this way, I can get data from many models to one view. Let see how rich user interface I can make this way.

Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
69
0
Dec 24
41
1
Dec 24
49
0
Dec 24
57
0
Nov 24
64