Odoo Help


How to store data to dynamic fields in openerp?

on 4/2/14, 5:12 AM 2,016 views

I have created a dynamic field through field_view_get function . The problem is that when I try to store data to this field . It does not get stored. The field is not showing anything . I am confused because I think I will have to make an entry for this field in my database.

1) How can this be done ?

2) Second thing is how can we set a button to fields_view_get function ? If I want to create dynamic fields through a button click then will it be possible through fields_view_get or not?

I have the same issue ,please give me the solution if you get it ?

ayman mohammed adam
on 8/20/14, 5:50 AM

i have also same issue, i want click on button create dynamic fields?

Vishal Gediya
on 2/9/16, 8:37 AM

I found the solution by create the field by using self._columns['%s'%field_name] = fields.float('%s'%field_view_name,readonly=True) if not analytic_account_child_ids: result['fields'].update({ field_name : {'type':'float','readonly':True}, })

ayman mohammed adam
on 5/19/16, 9:08 AM
On 8/20/14, 5:54 AM

fields_view_get() is used to modified the displaying of a view. If you add a dynamic field on this method, you must also add this field in the fields_get() method.

But, if you need to save the value of this dynamic field, you should create a new fields on your object to save its value on the DB. Else, you need to develop a method to save the value in your proper way (in a file, in memory or anything else).

i create my dynamic fileld and view , i just want to store that fields in database , please tell me how to add that fields in the fields_get() method?

ayman mohammed adam
on 8/20/14, 7:52 AM

In this case, you have to create a new Odoo module with an object that inherits of a base Odoo object and define a new columns for this object. After that, you have to modify the XML view of the object. fields_view_get() and fields_get() will not have to be overrided if you use the Odoo inheritance.

on 8/20/14, 10:21 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/2/14, 5:12 AM
Seen: 2016 times
Last updated: 2/9/16, 8:36 AM