跳至內容
選單
此問題已被標幟
1 回覆
7074 瀏覽次數

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

頭像
捨棄
最佳答案

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()).

頭像
捨棄
作者

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.

相關帖文 回覆 瀏覽次數 活動
5
2月 19
10283
1
2月 24
2740
1
6月 22
6412
1
10月 20
8792
2
9月 23
61368