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

Hi,

I added a compute field and do the calculation in function through when quantity is 0 or less than 0 popup error message. but when I go back trying to open form view I can't open the because error message comes.

I need to know is there any possibility to pop up an error message when I used to compute field.




アバター
破棄
最善の回答

Hi Dishan,


Try to write an onchange function instead. So the function will only trigger when the value in your field is changed. Also make sure you add a check to not show the error when there is no value in the field.


@api.onchange('value')
def _onchange_value(self):
if self.value:
if self.value <= 0:
raise UserError("Error")
          
アバター
破棄

How can this be done in the front end while creating a custom field

関連投稿 返信 ビュー 活動
2
2月 24
15649
1
12月 22
5077
2
12月 22
14588
2
6月 22
6473
2
6月 22
4806