Recid Count in real time when using modified method
We already discussed this in a duplicate thread, but it disappeared. Maybe someone deleted the wrong one by mistake. [Update: for some reason, no replies were shown to me for some time.]
Let me quickly repeat what I said there. The description isn't good enough; we can't help you until you do a better job in explaining your implementation and your problem. Let me try to help you with that.
It seems that you store information about checked records in database. Is it correct? If so, where you store it? In the table of "elements", or in a separate table? If a separate one, is it a persistent table or temporary? If you use a persistent table, it means the checking of records is shared by all users.
Regarding the calculation, didn't you forget that the current record hasn't been saved yet if you run your calculation in modified()? I think you should calculate it after saving the record. If you agree with me, you've used a wrong method. modified() is run before saving; do it in write() (below super()) instead.
If you insist on calculating the value before saving, you must add or subtract the current record from the number you get from database.