Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
25189 Tampilan

I know how to display confirm message on button click, like given below:

<button name="Name of the button"
    string="Showable label"
    type="object"
    confirm="Are you sure you want to do this?"
/>

But I want to achieve same functionality using python code.

Note: If we use `raise ValidationError('Error')` then it will terminate the execution, but I want to terminate execution only if the user click on cancel button which appear on dialog box else if click "OK" the it will simply continue execution like it happen if we add confirm attribute in button.

The code should be like this:

@api.multi
def write(self, vals):     statement 1
    statement 2
    if True:
        # Confirm dialog box will appear with the message whatever we include in it with ok and cancel button
    statement 3 # This statement will always execute unless the confirm dialog box appear and user click "Cancel" button.

Avatar
Buang
Jawaban Terbai

 
 

This will helpful using button xml

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Nov 17
9257
6
Des 23
19394
3
Mar 17
3529
0
Feb 23
1432
1
Apr 18
12597