I want to sort my lists by a computed field "due_days" (number of days - computed from "due_date").
I could do this by setting "store=True" on due_days, but then the compute method depends on the current date. How can I then be sure, that the value is re-computed when the current date changes?
It would also be easy to implement a new search method. Searching on due_days is the same as searching on due_date with ASC/DESC order reversed. But how can I tell Odoo to sort by this order?
I'm aware of the @api.depends decorator, but as far as I can see, it can only be triggered by other fields. As the "due_days" field depends on both "due_date" and the current date, we also need to re-calculate due_days when the current date changes.
Maybe I wasn't clear on the sorting, but I want the user to be able to choose the sorting when they see a list.