If you have been croplocked you will be able to do the following things:
- Upgrading a crop field always increases the free crop, that is why it may always be build.
- Grain mill and Bakery may be build/upgraded if they would increase free crop.
- Main Building level 1 may be built always.
- If 6 crop fields are level 5 and the amount of free crop is less than 0, then main building, warehouse and granary may be build/upgraded to level 10.
As for all of the other buildings, you can only commence their construction if you have a positive total production (without troops, hero’s production, Gold bonus) again.
Please also have a look here for a detailed explanation about the crop freely available for construction buildings.