In my SalesForce managed package I have a Batch Apex job that queries OpportunityHistory and does some post-processing (basically serialize them and posts to external Web Service)
When I schedule and execute this batch in my development organization everything works fine, however after packaging and installing on test org I get following error - Invalid field StageName for OpportunityHistory
It's interesting however that the similar code works completely fine for Opportunity object both in developer console in dev org and in installed package on test org.
In test org I do not see any logs for installed package so it's hard to predict why this happens. It's important to notice that package is installed with unrestricted access
It's obvious that StageName is a valid field for OpportunityHistory - so I cannot gues what can be the cause of this error.
Any help will be appreciated.