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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
please go through here
https://odoo-new-api-guide-line.readthedocs.io/en/latest/decorator.html
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
5
Feb 19
|
8409 | ||
|
1
Feb 24
|
771 | ||
|
1
Jun 22
|
4139 | ||
|
1
Oct 20
|
7190 | ||
|
2
Sep 23
|
56429 |