Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4181 มุมมอง

I  define function 'write' as below in .py file:

@api.multi
def write(self, cr, uid, ids, vals, context=None):
    raise Warning('his ds sf')
    res = super(Checks, self).write(cr, uid, ids, vals, context=context) #res stores the result of the write function
    return res

I hope when click 'edit' button, a raise box would pop out; but in fact nothing happen when I  click the 'edit' button.

shall I  get some advice for this?


อวตาร
ละทิ้ง

write is triggered after clicking on SAVE.

ผู้เขียน

so which function is triggered after clicking on EDIT?

คำตอบที่ดีที่สุด

The write method triggered only if you edit an existing record after you click on Save button not Edit button.

อวตาร
ละทิ้ง
ผู้เขียน

what shall I do if I want to run some code when I click the "edit " button.

Edit is a Framework button defined in web app defined in base.xml file in \web\static\src\xml and there is no python method link to it and it's controlled by javascript and I don't have more info about.

ผู้เขียน

thanks a lot!

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 19
5995
1
มี.ค. 15
5242
1
มี.ค. 15
4420
0
ธ.ค. 23
1262
3
ก.พ. 24
4767