تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
9896 أدوات العرض

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?

 

 

الصورة الرمزية
إهمال
أفضل إجابة

HI, you can follow following tutorial for this:

https://youtu.be/kwkddYoFQCE

Hope it helps,

Thanks

الصورة الرمزية
إهمال
أفضل إجابة

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.

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"/>

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 15
4275
3
سبتمبر 24
4169
1
أبريل 22
4226
1
فبراير 22
6927
0
أكتوبر 21
2659