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

How do we know that we are going to work in record or recordsets (multiple) or model. I just want to use some function in .py file, then how would I know whether i have to work on record, multiple records or in model?

Thanks

Avatar
Hylkää
Paras vastaus

Hi Bhuwan,

It always depends on the logic of your code. Mostly any function gets called from the button, must have api.multi.

If you have a function and you are calling it from another function with multiple recordsets, you should apply api.multi..

If you have another function and you always calls it with single record set, you can use api.one (Better to use api.multi and apply self.ensure_one()).

Avatar
Hylkää
Tekijä

Will you please suggest me with some example, you know I am a beginner and wants to know more about it? And what about model? Thank you for your reply too.

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
5
helmik. 19
10365
1
helmik. 24
2784
1
kesäk. 22
6473
1
lokak. 20
8828
2
syysk. 23
61499