跳至内容
菜单
此问题已终结
2 回复
4153 查看

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!

相关帖文 回复 查看 活动
1
8月 19
5986
1
3月 15
5232
1
3月 15
4411
0
12月 23
1239
3
2月 24
4755