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

I have this XML code


field name="my_company_payment_data_entry_mode" attrs="{'required': [('code','in',('my_company'))],'invisible': [('my_feature_enable', '=', True)]}" /

 

 field name="my_company_payment_data_entry_mode_read_only" attrs="{'invisible': [('my_feature_enable', '=', False)]}" /

(I know i am missing the ">" and the other one but i can't post with them in)


The field is set-up like this 

my_feature_enable= fields.Boolean(string=(""), default=constants.MY_COMPANY_PLUGIN_FEATURES.get('feature'))

And the constant like this 

MY_COMPANY_PLUGIN_FEATURES = {'feature': True,}

The problem i am facing is that, the fields that show in the configuration files is always the read only one and i have no idea why


It seems to be a probleme with my declaration of my field. I am not sure of how to declare a boolean fields


I am working with odoo 16

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

Ok so my probleme is that when i put my boolean fields in the view, i make it with the attributs invisible=1 which make it so it can't be seen but as a consequences the value can't be read either so it give False. Any solution to that?


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 24
1729
2
يناير 24
1168
2
يونيو 23
3856
0
يناير 24
750
0
يناير 24
710