Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
4175 Näkymät

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?


Avatar
Hylkää

write is triggered after clicking on SAVE.

Tekijä

so which function is triggered after clicking on EDIT?

Paras vastaus

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

Avatar
Hylkää
Tekijä

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.

Tekijä

thanks a lot!

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
elok. 19
5994
1
maalisk. 15
5242
1
maalisk. 15
4416
0
jouluk. 23
1258
3
helmik. 24
4765