コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
7240 ビュー

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
12月 15
14451
3
5月 25
1620
1
4月 25
1225
3
9月 24
14082
2
2月 24
2408