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

I'm searching to make invisible a field in XML view.

<field

     name="field1"

     attrs="{'invisible': [('field2', '=', False)]}"/>


This gives me the following error: TypeError: %u format: a number is required, not str

The stranger thing is that this happens only with some fields in condition

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

Hello Giuseppe matranga,

In the domain which field you have used 'field2' is the type of contain the numeric data so on the domain check it will not allow you to do.

// code

<field name = "field1" attrs = "{'invisible': [('field2', '=', 0)]}" />

Thanks ..

For more information Contact us:- https: //kanakinfosystems.com/odoo-development-services

الصورة الرمزية
إهمال
الكاتب

Field 2 is boolean field type...

But the domaini dosen't work also on some Datetime and Many2one fields..

based on the report error, 'TypeError: %u format: a number is required, not str'

it look like the field is integer,But if the field type is boolean then on the domain check with true/false.

need more error log and code to identify the cause.

المنشورات ذات الصلة الردود أدوات العرض النشاط
4
أكتوبر 21
80015
1
مارس 25
979
0
أكتوبر 17
4892
2
يوليو 18
15032
1
أغسطس 23
3264