This question has been flagged
3 Replies
8829 Views
Best Answer

Hello Ayman,

We can create dynamic view by using one of the strongest ORM method of OpenERP called field_view_get
################################
Following syntax:

fields_view_get(cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

Get the detailed composition of the requested view like fields, model, view architecture

Parameters:

  • cr -- database cursor

  • user -- current user id

  • view_id -- id of the view or None

  • view_type -- type of the view to return if view_id is None ('form', tree', ...)

  • context -- context arguments, like lang, time zone

  • toolbar -- true to include contextual actions

  • submenu -- example (portal_project module)

###########################


Good examples of how to utilize this method:

http://blog.openerp4you.in/2013/06/creating-views-dynamically-in-openerp.html

http://aasimania.wordpress.com/2011/04/09/creating-views-dynamically/

###########################

This will be an overview.Since your question seems to look partial ,so if you can elaborate your requirement then it will be more easy to provide you complete solution along with code.

Avatar
Discard
Author

thanks , I create the dynamic view but , how to store the dynamic fields in database ?

How to create dynamic view of the generated report? Means Instead of print when clicked the button(print button) in Financial report(or my custom fin.report) module,I should get a dynamic view. Is it possible?

ayman mohammed adam https://www.odoo.com/forum/help-1/partner/203280 , how do you create a dynamic view, i am in bad need of it, please can you explain?

Best Answer

Hi

One cannot change the Tree View based on form data ...

According  to Openerp Framework.. views(XML) will be loaded first then the data from your database will be retrived.. hence one cannot change the view which is already been loaded ...

Avatar
Discard
Best Answer

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Discard