Repository navigation
[19.0][ADD] ai_sale_product_matcher: find best-matched PIM products from requirement docs/images using AI - #106
volkantasci wants to merge 23 commits into
Conversation
|
All pre-commit checks are now green (prettier, eslint, ruff, ruff-format, pylint-odoo mandatory, OCA po/module checks):
Module tests run locally (Odoo 19, scratch DB with The |
This comment was marked as off-topic.
This comment was marked as off-topic.
…quirement docs/images using AI
…on invalid in Odoo 19)
…ent truncation/401)
…troller.model.load)
…racted text (fix empty extraction for spec sheets)
… fazla) and missing-neutral scoring
…mpts, live PIM key set
…duct must be top)
…pping (sector-independent but stable)
…Turkish translations
…ete Turkish translations
…(manual Find Matches only)
…in catalog schema
…arses it as a module
…-file lint ignores - Wrap over-long lines instead of ignoring E501 repo-wide - Split _validate_requirements per-type coercion into helpers (C901), behavior verified identical against the previous implementation - Log swallowed exceptions instead of bare except-pass (W8138) - Drop redundant field strings equal to field name (W8113)
Regenerated the .pot from Odoo 19 (i18n export) so it matches the current code (new filter fields, selection values, reworded messages). Deduplicated repeated msgids in tr.po, dropped a stale field reference, and msgmerged translations against the new template.
4dcb263 to
d2b08d0
Compare
|
Rebased onto the latest The Odoo/OCB test jobs still fail for the same reason, at dependency installation:
|
Adds
ai_sale_product_matcher— find best-matched PIM products from requirement docs/images using a vision LLM.What it does
Upload a spec sheet, email screenshot or type requirements (e.g. "120 bar soğuk sulu, monofaze, 2.3kW, deterjan tanklı") — the module extracts a canonical requirements JSON using the same
ai_connectionopenai_compatiblevision pipeline asai_document_extraction(only prompts differ), then scores allproduct.templaterecords against the PIM attribute catalog (katalog-sablonu.json→ 232 keys) with type-aware matching (range, tolerance, fuzzy, directionalen az/en fazla) and weighted groups. Top 10 matches are shown on the Sale Order with match % and can be added as order lines.Sales integration:
sale.order→ Find Products with AI wizard (file + text → Extract → editable JSON → Find Matches → Add to Order). Extraction runs viaqueue_job+busso UI never blocks.Key features:
pdf2image/Pillowpreprocessing, multi-page support, live PIM key set in prompt, English prompts sector-independent)queue_job+bus(non-blocking wizard)queue_job/bus/ai_connectiondeps, ACL, i18n (TR), testsTechnical notes
sale,product,bus,queue_job,ai_connection,ai_tool(same stack asai_document_extraction).ai_connectionOpenAI-compatible client; prompts filtered to non-null keys to avoid truncation/401.test_product_matcher,test_requirement_extractor).ir.model.access.csv,AGPL-3).cc @OCA/ai-maintainers