Stock Card OK - High Performance
by okkype@gmail.com https://linkedin.com/in/okky-permana-sihipo$ 79.00
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 900 |
| Technical Name |
stock_card_ok |
| License | OPL-1 |
| Website | https://linkedin.com/in/okky-permana-sihipo |
| Versions | 16.0 17.0 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 900 |
| Technical Name |
stock_card_ok |
| License | OPL-1 |
| Website | https://linkedin.com/in/okky-permana-sihipo |
| Versions | 16.0 17.0 18.0 |
⚡ Stock Card OK - High Performance Edition
87.5% Faster Stock Card with Near-Realtime Data
🚀 Performance Breakthrough
Query Speed
15s
vs 120s before
Performance Gain
87.5%
Faster execution
Data Freshness
1-5s
Auto-refresh delay
✨ Key Features
⚡ Materialized Views
PostgreSQL materialized views with optimized indexes for lightning-fast queries. Pre-calculated data ready for instant retrieval.
🔄 Auto-Refresh
Automatic refresh within 1-5 seconds when stock moves are validated. Smart debouncing prevents excessive refreshes during bulk operations.
🎯 Manual Control
User-friendly refresh buttons in wizard and balance views. Full control over when to refresh data for latest information.
📊 Data Freshness
Always know when data was last refreshed. Automatic warnings when data is older than 30 minutes.
⚙️ Configurable
Control auto-refresh behavior, debouncing delay, and cache retention through Settings > Inventory.
🕐 Scheduled Jobs
Hourly auto-refresh ensures maximum 1-hour staleness. Daily cache cleanup keeps database lean.
📋 Complete Feature List
- Starting balance calculation for any date range
- Ending balance tracking for each transaction
- Real-time stock movement tracking
- Flexible filtering by date, products, and locations
- Group by location, product, or operation type
- Support for internal and transit locations
- Valuation reporting (Quantity, Valuation, or Both)
- Smart "With Valuation" filter for valuation reports
- Automatic UOM conversion
- Operation type identification (Receipt, Delivery, Scrap, etc.)
- Origin and reference tracking
- Pivot view support for analysis
- Export to Excel/PDF
- Multi-company support
📈 Performance Comparison
| Metric | Before (SQL View) | After (Materialized) | Improvement |
|---|---|---|---|
| Initial Query | 120 seconds | 15 seconds | 87.5% faster |
| Refresh Time | N/A | 10 seconds | - |
| Data Freshness | Instant | 1-5 seconds | Near-realtime |
| Memory Usage | 2 GB | 600 MB | 70% reduction |
| User Control | None | Auto + Manual | Full control |
⚙️ Configuration
After installation, configure the module in Settings > Inventory > Stock Card Performance
Auto-refresh Stock Card
Enable/disable automatic refresh when stock moves are validated.
Default: Enabled
Refresh Delay
Minimum seconds between auto-refreshes (debouncing).
Default: 5 seconds
Cache Retention
Number of days to keep old balance data.
Default: 7 days
🚀 Quick Start
- Navigate to Inventory > Reporting > Stock Card
- Check the data freshness indicator at the top
- Click "🔄 Refresh Now" if you need the latest data
- Select your filters (date range, products, locations)
- Click "Generate Report"
- Use "🔄 Reload" or "⚡ Refresh Source Data" as needed
🔧 Technical Details
Database Objects
- Materialized View: Pre-calculated stock movements
- Index 1: Composite (date, product_id, location_id)
- Index 2: Product-location (product_id, location_id)
- Index 3: Date-based (date)
- Refresh Log: Timestamp tracking table
Scheduled Actions
- Hourly: Refresh materialized view
- Daily: Clear old cache records
Architecture
- PostgreSQL materialized views
- Automatic and manual refresh mechanisms
- Smart debouncing to prevent excessive refreshes
💡 Use Cases
Inventory Audits
Generate accurate stock card reports for any period with starting and ending balances for reconciliation.
Stock Analysis
Analyze stock movements by product, location, or operation type using group by and pivot views.
Compliance Reporting
Export detailed stock movement reports for regulatory compliance and financial audits.
Real-time Monitoring
Monitor stock movements in near-realtime with automatic refresh after each transaction.
Ready to Boost Your Stock Card Performance?
Experience 87.5% faster queries with near-realtime data freshness!
Perfect for warehouses with high transaction volumes and strict audit requirements.
📞 Support & Information
Author: okkype@gmail.com
Website: linkedin.com/in/okky-permana-sihipo
License: OPL-1 (Odoo Proprietary License)
Version: 18.0.0.2.0
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