1 答案
@api.model decorator used on methods for which only the model is important, not the contents of the recordset. so self should be used as a reference for the model, without expecting it to contain actual records.
In another words it's used when you need to do something with model itself and don't need to modify/check some exact model's record/records
@api.depends(fld1,...) is used for computed field functions, to identify on what changes the (re)calculation should be triggered. It must set values on the computed fields, otherwise it will error.
@api.onchange(fld1,...) is used in the user interface, to automatically change some field values when other fields are changed. The self argument is a singleton with the current form data, and the method should set values on it for the changes that should happen in the form. It doesn’t actually write to database records, instead it provides information to change the data in the UI form.
thank you Waleed Mohsen
can u give me information about all of the api in odoo 15
it is possible for you?
https://www.cybrosys.com/blog/common-orm-methods