Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
7098 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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.

Publications associées Réponses Vues Activité
5
févr. 19
10288
1
févr. 24
2747
1
juin 22
6425
1
oct. 20
8805
2
sept. 23
61388