Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Inventory
  3. Stock Lot Production Date with Aging Analysis v 19.0
  4. Sales Conditions FAQ

Stock Lot Production Date with Aging Analysis

by Osool Consulting https://www.osoolconsulting.com
Odoo
v 19.0 Third Party 27
Download for v 19.0 Deploy on Odoo.sh
This module requires Odoo Enterprise Edition.
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Barcode (stock_barcode)
• Inventory (stock)
• Discuss (mail)
Lines of code 1530
Technical Name stock_lot_barcode_production
LicenseOPL-1
Websitehttps://www.osoolconsulting.com
You bought this module and need support? Click here!
  • Description
  • License

Lot Production Date & Aging Analysis

Track manufacturing dates, surface slow-moving stock and measure aging risk — directly inside Odoo Inventory and the Barcode app.
Odoo 19.0 Enterprise Inventory · Barcode · Purchase OPL-1 License

What this module does

This module extends stock.lot with a first-class Production Date field, then uses it to compute aging metrics that feed a professional reporting suite — including executive dashboards, category KPIs, product-level aging, and a slow-moving inventory view. Production dates are also exposed in detailed operations, the Barcode app, and lot labels.

Why it matters: Standard Odoo tracks lots but gives you no easy way to see how old on-hand stock really is. This module fills that gap with SQL-view-backed reports that are fast at scale, color-coded for triage, and broken down by category, product, warehouse, and company.

Who this is for

Manufacturing

Track production batches and enforce FIFO/FEFO rotation.

Finance & CFO

Quantify aging exposure on working capital and identify inventory impairment candidates.

Quality & compliance

Full traceability from scan to label, including manufacturing date on every printed lot.

Inventory managers

Catch obsolete inventory before it becomes a write-off with the Slow Moving dashboard.

Core features

Production Date on every lot

Indexed production_date field on stock.lot with automatic propagation to related move lines, quants, and lot labels.

Shelf life & expiry

product.template.shelf_life_days drives a stored, indexed stock.lot.expiry_date — ready to query, sort and FEFO-pick against.

FEFO reservation helper

stock.lot.find_fefo_lots() returns lots ordered by oldest production/expiry, optionally filtered by on-hand quantity at a location.

Barcode & detailed ops

Production date is writable in stock.picking detailed operations and the Barcode app (picking and inventory adjustments).

Lot-name barcode scanning

The barcode scanner can resolve a scanned lot name, attach it to the right move line, and pre-fill its production date — including stripping GS1 AI prefixes (AI 10 / AI 21).

Enterprise-aware costing

Unit cost is derived from stock_valuation_layer when available, falling back to purchase price and standard price so totals stay accurate on Community installs.

Outbound velocity & days-of-stock

Ship-out volume over a configurable window (default 90 days) feeds a proper days-of-stock estimate — on-hand ÷ average daily outbound.

NUL-byte safe search

Lot/product/picking searches scrub NUL (0x00) characters from domains — the classic PostgreSQL invalid UTF-8 crash when noisy barcodes reach the database.

Lot label with Mfg date

The default report_lot_label template is extended with a Manufacturing Date line and dynamic product-name sizing.

Reports & dashboards

  • Aging Dashboard (Category) Executive kanban + list with value/percentage breakdowns by age band (0–6M, 6–12M, 1–2Y, 2Y+), a weighted aging risk score and a color-coded risk level (Low / Medium / High / Critical).
  • Aging KPI by Category Pivot, graph and list views — measures value, quantity, lot count, product count, and average/min/max age per category × age range.
  • Product Aging Analysis One row per product with lot count, total value, average age, the oldest lot (and its value), outbound velocity, and a real days-of-stock estimate.
  • Slow Moving Inventory Identifies obsolete stock by days since last movement: Active (<90d), Slow (90–180d), Very Slow (180–365d), Obsolete (>365d).
  • Lot Production Report Per-lot × location detail with quantity, unit cost, total value, first-receipt and last-movement dates, production date, age in years, and outbound-window quantity.

Age bands used across reports

0–6M Fresh stock
6–12M Aging
1–2Y Old
2Y+ Critical

Technical notes

Target Odoo version 19.0 Enterprise (Community also supported with reduced costing accuracy)
Dependencies stock, stock_barcode — purchase is detected at install time and wired in only if present.
Models added lot.production.report, lot.aging.kpi, category.aging.summary, product.aging.analysis, slow.moving.inventory (all _auto = False SQL views)
Models extended stock.lot, stock.move.line, stock.move, stock.picking, stock.quant, stock.location, product.product, product.template, uom.uom, product.uom, barcode.nomenclature, res.config.settings
Hooks post_init_hook rebuilds the 5 SQL views in dependency order; uninstall_hook drops them.
Security Read-only access to all report views for stock.group_stock_user and stock.group_stock_manager.
License OPL-1

Installation

  1. Copy this module into your Odoo addons path.
  2. Activate developer mode and install Stock Lot Production Date with Aging Analysis from Apps.
  3. Open Inventory > Reporting > Inventory Aging to find the new dashboards.
  4. Tune the outbound-velocity window under Inventory > Configuration > Settings > Lot Aging & Velocity.

Changelog

  • 19.0.4.0.1 2026-04-24
    • fix stock.lot.expiry_date now depends on product_id.product_tmpl_id.shelf_life_days directly (was a non-stored related field) so template edits reliably invalidate existing lots.
    • chore find_fefo_lots migrated from the deprecated read_group to the Odoo 19 _read_group signature.
  • 19.0.4.0.0 2026-04-24
    • fix Correctness: removed duplicate XML IDs across stock_lot_views.xml / barcode.xml; corrected age_years SQL math to a straight (CURRENT_DATE - production_date) / 365.25 (the previous formula over-counted via AGE() part sums); fixed stock.move.lot_production_date compute to pick the oldest lot date deterministically instead of whichever move line was iterated last.
    • fix Dropped the deprecated read_group override and moved aggregation to aggregator='sum' on the field definitions — this eliminates the N-extra-searches-per-grouped-row path.
    • fix Rewrote the stock_valuation_layer CTE to aggregate directly by svl.lot_id (positive rows only), so unit cost no longer mixes inbound and outbound valuations or double-counts quantities across joined move lines.
    • chore Added post_init_hook and uninstall_hook so the 5 SQL views are rebuilt in dependency order on install and dropped cleanly on uninstall.
    • chore Factored _has_nested_relational_domain into barcode_utils; introduced SanitizedSearchMixin so every _search override shares one implementation. Removed redundant search_read overrides (search_read → search → _search already flows through sanitization).
    • chore Centralised age-band thresholds, risk weights, and risk-level cutoffs into a single models/constants.py module; SQL CASE expressions are generated from it via age_band_case_sql / risk_weight_case_sql / risk_level_case_sql.
    • chore Dropped the hard purchase dependency — the purchase-price CTE is now added only when purchase_order_line and stock_move.purchase_line_id are present at install time.
    • feat Shelf life & expiry: product.template.shelf_life_days and a stored, indexed stock.lot.expiry_date computed from production date + shelf life. Exposed in the product form and lot views.
    • feat Outbound velocity: new outbound_qty_window column in lot.production.report aggregates ship-out quantity from internal to non-internal locations over a configurable window (default 90 days). Propagated to the aging KPI and product-aging views.
    • feat Real days-of-stock: product.aging.analysis.days_of_stock is now on-hand ÷ (outbound_qty_window ÷ window_days) instead of avg_age_years × 365 (which was a misnamed average-age). The original metric is still available under avg_age_days.
    • feat FEFO helper: stock.lot.find_fefo_lots(product_id, …) returns lots ordered by oldest production date / expiry, optionally filtered by on-hand quantity at a location. Ready for use from the barcode app or custom picking flows.
    • feat Configurable velocity window: new Inventory → Settings → Lot Aging & Velocity section exposes stock_aging_velocity_window_days. Saving rebuilds the dependent SQL views so the new window takes effect immediately.
  • 19.0.3.8.0 2026-04-24
    • chore Added module icon, store thumbnail and full HTML description page.
    • chore Manifest cleaned up — verbose RST description moved into static/description/index.html.
  • 19.0.3.7.7 2026-04-24
    • fix Inverted filter on Location Report (and any list with a contains filter on a Product many2one). sanitize_domain was normalising the internal any! / not any! operators as if ! meant negation; it actually means "same semantic, bypass record rules on the comodel". any! is now mapped to any and not any! to not any, preserving the original direction of the filter.
  • 19.0.3.7.6 baseline
    • feat Production date on stock.lot with indexed field, propagation to move lines / quants / lot labels, GS1 AI-prefix aware barcode scanning and NUL-byte sanitization on domain searches.
    • feat Reporting suite: Lot Production Report, Aging KPI by Category, Category Aging Dashboard, Product Aging Analysis, and Slow Moving Inventory — all SQL-view backed.
© Osool Consulting  ·  osoolconsulting.com  ·  Support: Mohammad.abbadi@outlook.com
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
  • Ratings
  • Discuss
There are no ratings yet!
by
Cláudia Ribeiro
on 5/7/26, 6:56 AM

It´s ok now

Thanks


I sent a screenshot by email.
by
Cláudia Ribeiro
on 4/27/26, 5:15 AM



by
mohammad.abbadi@outlook.com
on 4/24/26, 5:35 PM Author

can you try it now?


Hi, We've identified errors after installing your module when filtering/grouping by in the inventory module. Could you please check this? What is happening is that the filter logic applied to the Product field together with the "contains" operator is being inverted, which causes Odoo not to correctly filter the selected product in the Location Report.
by
Cláudia Ribeiro
on 4/24/26, 4:30 AM


Hi, We've identified errors after installing your module when filtering/grouping by in the inventory module. Could you please check this? What is happening is that the filter logic applied to the Product field together with the "contains" operator is being inverted, which causes Odoo not to correctly filter the selected product in the Location Report.
by
mohammad.abbadi@outlook.com
on 4/24/26, 4:54 PM Author

dear, thanks for the report, but can you mail me screen shot or record for the error, so i can under more about how it happened?


Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with