Odoo Help


2 beginner questions about function(fields_view_get)

Yannik Lieblinger
on 4/9/13, 6:15 PM 3,231 views

I am try create a new Module. I define in the first class some columns(type=char) in these are some field names and I want to display these enteries as fields in another class.

But I don't really understand some parts of the following function.

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
    result = super(categories, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)

What does the next line do? Can I specify here the classes from where the function will read the fields?

school_obj = self.pool.get('sim.categories')
return result

How can I tell the function to get the fields from a specific class and how can I display the result in a form for debugging and testing?

Can you give me a Module name in which a dynamic field view was already realized? I think in post_return from v6 is something that I want. Is this code compatible to v7 or give it a better solution?


Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
| 2 1 4
Ahmedabad, India
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 4/10/13, 2:04 AM

You can not display the fields of one class in the view of another class unless and untill you have made inheritance.

So please check you make inheritance of categories (Parent class) if yes then you can directly use XML record to add new fields on the views.

Regards, Mustufa Rangwala

Thank you for the reply. I want to create fields dynamic based on entries in the DB. Can you give me an example how I display a result(return) of an function anyway in a form. Maybe in a text field?

Yannik Lieblinger
on 4/10/13, 2:16 AM

I use the print function to display the result of this function in console. But the result was empty. Can this function build fields out of DB entries in a specific column?

Yannik Lieblinger
on 4/10/13, 11:00 AM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/9/13, 6:15 PM
Seen: 3231 times
Last updated: 3/16/15, 8:10 AM