Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7108 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 2 19
10291
1
thg 2 24
2750
1
thg 6 22
6432
1
thg 10 20
8810
2
thg 9 23
61392