I just began learning Tryton framework and, first, I wish to say how it looks great !
So, sorry if my first questions seem dumb…
If have some calculated fields (readonly on the view side). If I do any change in the calculation code, how to force the system to recalculate these fields’ values ?
tytond-admin -u doesn’t seems to launch any recalculation.
As far as I understand, calculated fields should not be stored in the DB. Tryton has fields.Function() that calculates the value dynamically and is not stored in the DB.
Otherwise, when updating code or needing migrations, there is a pattern used in official modules using the __register__() method.
Another option is creating a proteus script to perform specific tasks in the DB. They use it to create the demo DB.
Thank you for this kind and well documented answer.
I understand now that these fields should be calculated ‘on the fly’, I can apply this advice for most of the cases.
As far as I know, searcher function can only return domains for fields in the database.
But then, how one should handle search for the most complex logics, that can only implemented in Python and barely not in SQL ?
Function fields are automatically updated on server side, if you need to update the values on the client side you can combine them with on_change_with methods