Page count field shows wrong number of pages

When I insert a page count field before any of the endnote markers, the field shows wrong number of pages (it simply ignores pages used for endnotes, so instead of 15 you will have, for example, 14). Is there any workaround for this bug?

(Here is a detailed explanation:

Not sure, but quite a lot of fields don’t auto-update, and this may be one of them. The TOC also doesn’t auto-update.

@floris_v In case of ToC, you can simply update it manually, save your changes, and that’s it. (Yes, this may be boring at times.) In case of page count field, you will need to update it manually (by pressing F9) each time you open a document. This is much worse and I would say this really seems to be a bug and not a some kind of a feature.

Confirmed, added comment in the Bug tracker.
Edit I saved my test document and reopened it, the field value is correct. Lots of people who use LibO, save in the MS file formats, and in some cases you can get compatibility problems saving in those formats. All experienced users who I met, recommend that you save files in the native format of the software that you work with. In the case of LibO, that’s odt.

I have since a long time ago, added Update All icon to the Standard toolbar, mainly to update TOC during final revisions but also occasional table calculations, etc. Tools > Customise. Cheers, Al