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

Hi,


i'm trying to call a function in python with following buttons:

<form string="Settings" class="oe_form_configuration">
     <header>
         <button string="Apply" type="object" name="execute" class="oe_highlight"/>
         <button string="Cancel" type="object" name="cancel" class="oe_link"/>
    </header>
     ...
</form>

But, they will never be called. After some time, I saw that is just called the method of update, that is, def write(...).

Can someone help me understand the problem?


Best regards

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

Hi,


I solved this with:

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

Put the name first before the string

 <button name="execute" string"Apply" type="object" class="oe_highlight"/>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 17
2924
1
thg 1 16
6277
4
thg 1 16
6303
4
thg 7 20
8413
0
thg 12 19
3765