Context
While logging a chore, sub chores can be selected via field_sub_chores on the chore log.
Logging a child chore individually does not connect it to it's parent automatically.
This leads to different results when adding logs from the top down vs bottom up.
The field was added to get a form widget for logging children, but creates a redundant relationship between items, as we already have field_parent_chore_log.
Chore logs have field_chore_log_state, added to handle scheduled and in-progress tasks. But it's not used yet, so all chore logs should be set to done.
Ideas
With chore log status working, starting a root chore (Clean bedroom) could create chore logs as scheduled or in-progress.
Questions
Is this achievable with ECA, or do I need some custom code?
TODO
Remove field_sub_chores.
Create a custom field or form for selecting sub chores, but don't save the values on the log.
Create a service or eca for updating existing parent chore logs when a child is added.
Done
Used claude to refactor.
What changed
- field_sub_chores is gone. The sub chores on a chore log are now worked out from the logs beneath it, through field_parent_chore_log. On the form, the
checkbox tree looks the same. Ticking a chore creates its log. Clearing a tick on an existing log deletes that log, and any logs beneath it move up a
level.
- No log is created for a chore nobody ticked. If you tick a grandchild without its parent, the grandchild's log hangs straight off the log above. If the
parent is logged later, the grandchild moves under it. Finishing every sub chore never completes the parent.
- Logging bottom-up uses the same tree. A chore logged on its own joins that day's log of its nearest parent or grandparent chore. If you log the parent
afterwards, it takes in that day's logs of its sub chores. Logs on other dates are never joined.
- Delete form: when a log has logs beneath it, the form asks "Keep them" or "Delete them too". Deletes that don't go through that form (bulk actions, code)
keep them.
- ECA: the two models that created and deleted sub chore logs are removed, along with the chore_log_children view. This now runs in PHP, in a ChoreLogTree
service in inventory_custom. The ECA model that updates each chore's last log and due date is unchanged.
A safeguard I added. "Clear off reclining chair" is unpublished, so the form doesn't offer it, and the form leaves out any chore it doesn't offer. Without a
guard, saving its parent log would have deleted that log. So a save can only delete logs of chores the form actually showed.
Data migration
Update inventory_custom_update_10005 ran locally. 22 logs from before the automation existed (2025-12-23 to 2026-08-07) had ticked sub chores but no logs
for them. For those dates, the update first linked sub chores you had logged separately the same day, then created 21 logs for the ticks still missing one.
Three ticks were dropped with the field:
- Log #164 ticked "Vacuum bedroom floor", which no longer sits under "Vacuum floor".
- Logs #349 and #351 ticked "Empty dish drainer". They already had sub chore logs, so the missing one looks like a log you deleted.Additional fixes
1. field_last_chore_log is deleted. This was the legacy reference nothing had written since August, which was still editable on the chore form.
2. process_khn4gcv is deleted. This was the disabled unpin model.
3. field_latest_chore_log is deleted. It stored the last log date a second time, as a timestamp.
- The "Chore: set next due date" model no longer writes or clears it, and now works out the next due date from the log's own date. I edited the BPMN
model and saved it through the modeler, so its config was regenerated rather than hand-edited.
- The content search index and the chores_search view now sort and show "Last done" from field_last_chore_log_date. I rebuilt and re-ran the index: 171
items.