Hi, I was reading about Odoo Guidelines, expecially this:
- In a Model attribute order should be
Private attributes (_name, _description, _inherit, …)
Default method and _default_get
Field declarations
Compute, inverse and search methods in the same order as field declaration
Selection method (methods used to return computed values for selection fields)
Constrains methods (@api.constrains) and onchange methods (@api.onchange)
CRUD methods (ORM overrides)
Action methods
And finally, other business methods.
I see that in 'sale' addon within sale_order.py (sale.py in Odoo14 and previous version), @api.depends like amount_all, get_invoiced, get_invoiced_status and many others have been declared BEFORE field declaration.
Since I'm extending sale order model for my company and I also re-defined _amount_all() method, I was wondering if there is a specific reason behind this choice.
Thanks, and have a good day !