instead of hitting the database with a sum-query, you could calculate the stuff based of the activities collection like this
self.activities.map(&:hours).sum
Reference: https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/