Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4409 Lượt xem

i want to just show warning message to user but want to save data .....

For Example 

limt is 5000 

user add 4500 

your remaing limit is 500 show in popup and save data .....



```

elif mVal <= val <= totalVal and mCont <= cont <= totalCont: 

 raise exceptions.Warning('Your Value Between Threshold line') 

 return res

```


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

try this

@api.onchange("field_name")
def function name(self):
if self.field_name<5000:

x=5000-self.field_name

 return {
'warning':{
'title': "title of the warning",
'message': "warning message %n" %x,
},
}

Ảnh đại diện
Huỷ bỏ
Tác giả

but i want to return res

first show warning message then return my res any help pls

Dear Usman Farzand,
Did you find the solution? To show a popup message and let the program run its next logic?

@Muhammad Anees which extly your prlbm is ?