I’m trying to define the ordering method of a custom Function field in invoice line. This field has a getter method that gets value from different models depending on invoice line origin.
Let’s explain it more in detail:
- the function field is an “origin_date” and is visible in standalone invoice lines.
- when the origin is a purchase, the value is the purchase_date of the purchase
- when the origin is an stock move, the value is the effective date of the move.
Define the ordering for each case is clear to me, but not how to combine them.
Is it possible? Any help will be appreciated.