Missing Movements in the Average Cost Report in Odoo 19: The Definitive Fix
Find out why your receipts don't appear in inventory valuation and apply an automatic fix without advanced programming.
The mystery of the empty report
Picture closing the month. You have recorded all your purchases, your goods receipts are validated and your warehouse is full. Yet when you open the new Average Cost Justification report (stock.avco.report) in Odoo 19 to audit your product valuation, you get an unpleasant surprise: the report is blank.
It doesn't show the receipts you just validated. You check your product category settings and it clearly says "Average Cost (AVCO)". Everything seems properly configured, but the data simply isn't there. If this has happened to you, you are not going crazy and you have not misconfigured your ERP. You are facing a very specific technical behavior of version 19.
Carlos and the impossible close
Carlos, logistics manager at a component distributor, spent three hours reviewing delivery notes one by one. "I know we received 500 units yesterday," he told his accountant, "I can see it in the stock move!" But the accountant, looking at the financial valuation report, only saw zeros. Carlos tried something desperate: he changed the product category to "Standard Price", saved, and switched it back to "Average". Magically, the lines appeared! Carlos fixed that product, but he had 4,000 more in the catalog. Would he have to do that trick manually, one by one?
Why does this happen? The conflict between what you see and what exists
To understand the problem, we need to look under the hood of Odoo. In recent versions, to optimize performance and handle multiple companies, Odoo stores certain settings not as plain text but inside complex data structures called JSON.
The problem comes from the system's "excessive intelligence". When a product category has a default value (such as "Average Cost"), the Odoo interface shows that value because it is what "should" be. However, if you never explicitly modified and saved that category for your specific company, the real value in the database may be empty.
Here is the trap: the AVCO Justification report is very strict. Unlike the screen that fills gaps with default values, the report goes straight to the database and asks: "Is it explicitly written that this is Average Cost for this company?" If the answer is "nothing is written", the report ignores all movements of that product, assuming it should not value them.
Carlos's revelation
When we explained this to Carlos, he understood it with a warehouse analogy: "It is as if I had a box labeled 'Miscellaneous' by default. I assume there are screws inside because there are always screws, but if the auditor opens the box and doesn't see a signed note saying 'Screws', they act as if the box doesn't exist." His trick of changing and saving worked because it forced Odoo to write that signed note into the database.
The solution: a safe, mass correction
You don't need to edit your thousands of products manually. We designed a solution that uses a Server Action to "wake up" this data. Basically, we tell the database: "Take the value you think you have and firmly write it into the record".
Follow these steps to create a magic button that repairs your products:
Step 1: Activate Developer Mode
- Go to Settings.
- Scroll to the bottom and click Activate developer mode.
Step 2: Create the Server Action
- Navigate to Settings > Technical > Actions > Server Actions.
- Create a new action with these details:
- Name: Fix AVCO Report (Categories)
- Model: Product (product.product)
- Action to perform: Execute Python code
Copy and paste the following safe code into the code area:
# Safe Repair Script for Odoo 19
# Simply "makes official" the cost configuration in the database
# 1. Identify the categories of the selected products
affected_categories = records.mapped('categ_id')
count = 0
company_id = str(env.company.id)
for cat in affected_categories:
target_method = cat.property_cost_method
# Only act if there is a valid configuration
if target_method:
# Prepare the value in the exact format the database expects
json_patch = '{"%s": "%s"}' % (company_id, target_method)
# SAFE INJECTION: Directly update the database
# This ensures the value is recorded even if Odoo thinks it was already there
env.cr.execute("""
UPDATE product_category
SET property_cost_method = COALESCE(property_cost_method, '{}'::jsonb) || %s::jsonb
WHERE id = %s
""", (json_patch, cat.id))
count += 1
# Refresh so Odoo knows there were changes
cat.invalidate_recordset(['property_cost_method'])
# Success message for the user
action = {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': 'Repair Completed!',
'message': f'Successfully repaired {count} product categories.',
'type': 'success',
'sticky': False,
}
}
Step 3: Run and Resolve
- Go to your Inventory > Products list.
- Select all products (you can use the master checkbox to select the whole catalog).
- In the Action menu (the gear icon), select Fix AVCO Report (Categories).
- You will see a green confirmation message at the top right.
The happy ending
Carlos created the action, selected his 4,000 products and ran it. It took less than 5 seconds. With his heart racing, he went back to the AVCO Justification report and refreshed the page. There they were: thousands of movement lines, accurate valuations and correct calculations. He was able to close his month that same afternoon, confident that his inventory reflected the company's financial reality.
Situations like this remind us how important it is to have tools that give us real control over our data. If you run into strange behavior in new Odoo reports, remember: sometimes all it takes is a small push for the "invisible" data to come to light.
Hire your Odoo implementation or consulting with Ganemo. Request your quote via WhatsApp +1 (828) 672-6150 or by email: leads@ganemo.com