LVISnet wholesale price import#
LVISnet is the joint product and price catalogue of Finnish HVAC and electrical wholesalers. ELT uses it for real-time wholesale prices in the installer’s PWA product search: when an installer scans a barcode on site, they see the right wholesale price and availability.
We support these wholesalers: Onninen, Dahl, Ahlsell, Sonepar.
How the import works#
Field Service → LVISnet → Fetch Sources lists the wholesalers. Each row has:
- Active flag: whether LVISnet should be fetched automatically?
- Last run state and timestamp
- Pricelist prices are stored to
- Wholesaler link (the wholesaler on the Odoo side)
Automatic fetch is the 1st of the month at 21:25
(_cron_fetch_all). Fetch manually if LVISnet announces an
out-of-band price update:
- Field Service → LVISnet → Fetch Sources.
- Click the Onninen / Dahl / Ahlsell / Sonepar row.
- Fetch now button.
- The wholesaler is marked “fetch_requested”; the dispatcher cron (every minute) picks it up and starts.
What one fetch does#
- Lists the OpusCapita catalogue (REST API) → list of zip files.
- Downloads the zip (e.g.
OLTUOTE.zip— Onninen Product file). - Opens and finds the inner TXT file in OVT format.
- Detects the type:
HINTA.txt→ prices → goes into the pricelist’s pricelist_itemTUOTE.txt→ product info → goes into product_template
- Imports row by row, commits every 1000 rows (since 200.14).
The import is a big operation: a single wholesaler’s TUOTE file can be 170,000+ rows, takes ~2 hours the first time. Once most products are already in the database, daily runs are faster (~20–30 min) because many rows are UPDATEs not CREATEs.
Progress monitoring#
Field Service → LVISnet → Fetch Runs:
| Column | What |
|---|---|
| Source | Which wholesaler |
| State | running / ok / error / partial |
| Started / Finished | Time range |
| Files imported | How many files succeeded |
| Summary | Real-time progress, e.g. “Importing OLTUOTE.txt: 87,000 / 171,540 rows” — updates every ~40 s |
Summary is new (200.15) — earlier the state just said “running” for an hour or two, with no signal whether things were progressing or stuck.
Watchdog#
If an import hangs for over 4 hours without progress (typically:
worker process killed via SIGKILL, container restart), the
_unstick_stale_runs watchdog automatically marks it as
error and reopens other wholesalers for re-run.
Previously (60 min watchdog) this killed healthy long imports — now 4 h gives sufficient headroom (200.15).
Daily check#
In the morning:
- Open Fetch Runs, filter to “Today”.
- Verify all 4 wholesalers are in ok state.
- If something is in error, click → Summary tells you why:
Stuck for >240min→ investigate Odoo lockingXML parse error→ reported via supportConnection refused→ LVISnet is down, retry later
- If
partial, some file succeeded but another didn’t. Try re-running with Fetch now.
Product and price visibility#
After an import:
- Products appear in Inventory → Products
- Wholesale prices appear in each product’s Pricelists tab
- Availability is in the
lvisnet.product.wholesaler.stockrows (per product × wholesaler) - PWA product search syncs automatically: the installer sees the correct wholesale price when scanning a barcode