Businesses such as Walmart makes tons of short-lived fresh food everyday (Bread, Coffee..etc) and at the end of the day there's so much food left unsold how do they do accounting for those food? Is it OK for businesses to record those things as production overhead?
Any business, like any household, has items that are wasted. Unlike a household, a business does keep track of all items that are unsellable. Depending on the reason for the item being unsellable they are accounted for differently.
Items that can be returned to the manufacturer are done so, and the business is given credit for that item. For the business the time spent processing, stocking and restocking that item, plus any time spent handling a return for that customer is harder to track. If they see the percentage of bad items is too large compared to sales they will want to address this with the manufacturer.
Items that are spoiled by the business, which will include spoiled food items, will also be tracked. They will examine their choice of products, their procedures for those products and the quantities produced to try an minimize the spoilage. They don't just throw the items away, they keep track of the exact items and their worth. When they have to dispose of meat that has reached their "sell by" date they will actually scan the items into the computer.
In some cases products can be transformed into other products: bread into bread pudding; in other situations they are "reduced for quick sale"; in other cases they are donated to a charity or food kitchen. All of this is also tracked.
Of course any losses that the company can't recover by returning items to manufactures or repurposing will be reflected in the price of their items. Stores that can minimize their waste can offer lower prices.