Deltatech Competitors Price
by Terrabit https://www.terrabit.ro , Dorin Hongu https://www.terrabit.ro| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 282 |
| Technical Name |
deltatech_competitors_price |
| License | OPL-1 |
| Website | https://www.terrabit.ro |
Deltatech Competitors Price

Deltatech Competitors Price
Track competitors’ product prices directly on the product form and fetch current prices on demand (or via future automation).
Overview
This module adds a new tab on Product Template where you can register competitor product URLs and retrieve their latest public price. It is designed to help sales and purchasing teams quickly compare your product pricing against selected competitors.
Key Features
- Competitor lines on product template with:
- Competitor name
- Product URL on competitor website
- Last fetched price and currency
- Last fetch timestamp and status message
- Auto Fetch flag (for potential scheduled jobs)
- On‑demand fetching:
- A per‑line “Fetch” button
- A product‑level button “Aducere pret concurenta” to fetch all lines at once
- Robust price extraction:
- First tries structured data (JSON‑LD / Microdata) via extruct when available
- Falls back to HTML heuristics using lxml selectors
- Graceful error handling with clear status stored per line
How It Works
- When you press “Fetch” (on a line) or the product button, the module performs an HTTP GET to the competitor URL using a browser‑like User‑Agent.
- If extruct is installed, the module attempts to parse JSON‑LD/Microdata and extract price and currency (Offer/AggregateOffer patterns).
- If no structured data price is found, it tries common HTML selectors (meta tags and elements whose class/name suggests price) using lxml.
- The found price is written on the line, together with the fetch timestamp and an “OK” status. If a currency code is detected and exists in your DB (e.g., EUR, USD), the line’s currency is updated accordingly.
- If nothing can be extracted, the line gets a clear status (e.g., “Price not found on page”).
Usage
- Open any Product (Product Template) and go to the “Competitor Prices” tab.
- Add one or more competitor lines:
- Competitor: e.g., “Altex”
- Product URL: the full URL of the competitor’s product page
- Click “Fetch” on a line to update just that entry, or use the product‑level button to fetch all lines.
Dependencies
Python libraries used at runtime:
- requests
- lxml
- Optional: extruct and w3lib for structured data (JSON‑LD/Microdata) parsing
If extruct is not installed, the module still works via HTML fallback.
Security & Access
- Internal users (base.group_user) can read/create/write/delete competitor lines by default. Adapt access rules to your needs.
Notes & Limitations
- Competitor websites vary widely. While structured data improves accuracy, some pages may hide or obfuscate prices; heuristic extraction may fail. Site‑specific selectors can be added if needed.
- Automatic/scheduled fetching (cron) is not enabled by default but can be added easily later, using the provided auto_fetch flag to mark lines eligible for periodic updates.
Testing
The module ships with an Odoo test suite which mocks HTTP requests to ensure deterministic results:
- Validates JSON‑LD/Microdata extraction path
- Validates HTML fallback via meta tags
- Validates proper error handling and product‑level action
Run with a disposable DB, for example:
./odoo/odoo-bin -c odoo18.conf -d o18_test -i deltatech_competitors_price --test-tags=deltatech_competitors_price --stop-after-init
License
OPL-1
Table of contents
Bug Tracker
Bugs are tracked on Terrabit Issues. In case of trouble, please check there if your issue has already been reported.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- Terrabit
- Dorin Hongu
Maintainers
This module is part of the dhongu/deltatech project on GitHub.
You are welcome to contribute.
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