Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7189 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Difference in Record and Recordsets? แก้ไขแล้ว
5
ก.พ. 19
10404
1
ก.พ. 24
2830
1
มิ.ย. 22
6533
How to get the ID of the instance? แก้ไขแล้ว
1
ต.ค. 20
8867
2
ก.ย. 23
61625