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

Possibility to add dynamic fields in Form view

By
Michael Pol
on 3/10/15, 4:11 AM 837 views

I have a kind of requirement where user wants to add some fields in quotation dynamically. These fields will be of type char. User can add upto 10 fields in quotation form. Fields name can vary as per quotation data.

Using developer mode fields can be added. But the problem is those fields will be visible in all quotation forms. 

I know this is weired question because fields are mapped with columns in table. 

Is there any one faced such scenario to add custom fields for some records only?

 

 

0

Temur

--Temur--
2896
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 3/10/15, 5:18 AM

Using one2many field should be a solution (User can add upto N fields). You'll need to implement simple model  as a related object with two fields: name and value (as "Fields name can vary")

Thanks Temur. Putting One2many field was last option I thought. One2many field looks different than normal fields but It will satisfy requirement.

Michael Pol
on 3/10/15, 7:37 AM

You can change how a field looks by using custom widget. Implement widget in javascript (inherit closest widget to your requirements) and then in XML set widget property for the fields like this: <field name="my_field_name" widget="my_custom_widget"/>

Temur
on 3/10/15, 8:45 AM

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

1 follower(s)

Stats

Asked: 3/10/15, 4:11 AM
Seen: 837 times
Last updated: 3/16/15, 8:10 AM