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

I found that a field could be made required based on the state of the record, using the state expression as follows:

'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), readonly=True,  states={'draft':[('readonly',False)]}),

where this is a field in the account_invoice table

I need to extend this behavior to use any other field, how can I achieve this.


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

I don't know if it's possible on a field definition level, but on a view level it is :

<field name="default_debit_account_id" attrs="{'required':[('type','in', ('cash', 'bank'))]}" />
الصورة الرمزية
إهمال
الكاتب

Thx for help, it worked fine. I 'm also pleased that I'm the first one who upvoted one of your answers.

المنشورات ذات الصلة الردود أدوات العرض النشاط
6
ديسمبر 15
14438
3
مايو 25
1576
1
أبريل 25
1177
3
سبتمبر 24
14016
2
فبراير 24
2377