تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
6048 أدوات العرض

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

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Hi,


I solved this with:

@api.one
الصورة الرمزية
إهمال
أفضل إجابة

Put the name first before the string

 <button name="execute" string"Apply" type="object" class="oe_highlight"/>
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 17
2875
1
يناير 16
6227
4
يناير 16
6234
4
يوليو 20
8358
0
ديسمبر 19
3731