Thursday, June 20, 2019¶
I worked on #3086 (together with Hamza at the beginning). Some optimizations for managing absences and holidays of workers.
Changes needed for Lino Presto.
presence_guestis specified this filter no longer applies to entries whose type has
all_roomsenabled (which is the case e.g. for holidays).
Multi-day events must be shown on every day of their date range. Lino didn’t yet handle them correctly
I added a field
lino_xl.lib.cal.EventType.fill_presencesbecause not all events should automatically fill their presences (
lino_xl.lib.cal.EntryStates.edit_guestsis True, Lino also removes unwanted guests each time you hit the save button. But for example in Lino Presto when registering a absence day or a worker, the list of suggested guests is usually empty (because the project is empty), and we don’t want Lino to remove any manually added guests.
En passant this caused an avalanche of optimizations.
I reviewed the way how the filter parameters for calendar entries
lino_xl.lib.cal.Event) are being inherited by the calendar views.
Especially this was a bit too hackerish for me:
@classmethod def setup_parameters(cls, fields): cls.params_layout = rt.models.cal.Event.params_layout cls.parameters = rt.models.cal.Event.parameters super(Events, cls).setup_parameters(rt.models.cal.Event.parameters)
There is a danger that this caused bugs which are not covered by the test suite.