Skip to content

Commit 8f69a72

Browse files
feat(sale): Add product search by supplier info
This commit introduces the `sale_product_supplierinfo_search` module, which allows users to search for products on sales order lines and in the global product catalog by using the vendor's product code or product name. Key features: - Overrides `_name_search` on `product.product` to extend search capabilities. - Activates the extended search via a context key on the sales order line. - Adds a user-friendly "Search in Vendor Info" filter to the main product search view. - Modifies the search result display to include the vendor's product code for better user context. - Includes comprehensive unit tests to validate the new functionality. - Provides OCA-compliant documentation and demo data.
1 parent 64febf8 commit 8f69a72

File tree

17 files changed

+424
-0
lines changed

17 files changed

+424
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Sale Product Supplierinfo Search
2+
3+
This module extends the search functionality on the sales order line and in the product catalog to allow users to find products by their vendor's product code or name, as stored in the supplier information (`product.supplierinfo`).
4+
5+
## Business Case
6+
7+
For businesses that use an internal reference system for products to mask the original manufacturer's part number, this module provides a significant workflow improvement. Sales teams can directly search for a product using the vendor code a customer might provide, without needing to leave the sales order to look it up in the product catalog first. This speeds up the quoting and sales process and reduces errors.
8+
9+
## Configuration
10+
11+
No special configuration is needed. The extended search is automatically enabled on sales order lines. To use it in the main product search view, select the "Vendor Product Code" or "Vendor Product Name" filter.
12+
13+
## Usage
14+
15+
1. **On a Sales Order Line**:
16+
* Click on the "Product" field to open the search dropdown.
17+
* Type the vendor's product code or product name.
18+
* The matching product will appear in the search results.
19+
20+
2. **In the Product Catalog**:
21+
* Go to `Sales > Products`.
22+
* In the search bar, click the filters dropdown.
23+
* Select "Vendor Product Code" or "Vendor Product Name".
24+
* Enter the vendor code/name in the search bar.
25+
26+
## Known Issues / Roadmap
27+
28+
* The display name in the search dropdown is not yet modified to show the vendor code. This is a planned improvement.
29+
30+
## Bug Tracker
31+
32+
Bugs are tracked on [GitHub Issues](https://github.com/OCA/sale-workflow/issues). In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.
33+
34+
Do not contact contributors directly about support or help with technical issues.
35+
36+
## Credits
37+
38+
### Authors
39+
40+
* Odoo Community Association (OCA)
41+
42+
### Maintainers
43+
44+
This module is maintained by the OCA.
45+
46+
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
47+
48+
This module is part of the [OCA/sale-workflow](https://github.com/OCA/sale-workflow) project on GitHub.
49+
50+
You are welcome to contribute. To learn how please visit [https://odoo-community.org/page/Contribute](https://odoo-community.org/page/Contribute).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
from . import models
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
{
3+
"name": "Sale Product Supplierinfo Search",
4+
"summary": """
5+
Search for products by vendor's product code or name on sales order lines.
6+
""",
7+
"version": "19.0.1.0.0",
8+
"category": "Sales",
9+
"website": "https://github.com/OCA/sale-workflow",
10+
"author": "Odoo Community Association (OCA)",
11+
"license": "AGPL-3",
12+
"application": False,
13+
"installable": True,
14+
"depends": [
15+
"product",
16+
"sale_management",
17+
],
18+
"data": [
19+
"views/sale_order_views.xml",
20+
"views/product_views.xml",
21+
],
22+
"demo": [
23+
"demo/demo.xml",
24+
],
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data noupdate="1">
4+
<!-- Demo Supplier -->
5+
<record id="res_partner_supplier_acme" model="res.partner">
6+
<field name="name">ACME Supplier</field>
7+
<field name="is_company">True</field>
8+
</record>
9+
10+
<!-- Demo Product -->
11+
<record id="product_product_demo_sku" model="product.product">
12+
<field name="name">Demo Product (SKU)</field>
13+
<field name="default_code">INTERNAL-SKU-123</field>
14+
<field name="type">product</field>
15+
</record>
16+
17+
<!-- Supplier Info for the Demo Product -->
18+
<record id="product_supplierinfo_demo" model="product.supplierinfo">
19+
<field name="partner_id" ref="res_partner_supplier_acme"/>
20+
<field name="product_tmpl_id" ref="product.product_product_demo_sku_product_template"/>
21+
<field name="product_name">ACME Super Widget</field>
22+
<field name="product_code">ACME-VENDOR-CODE-XYZ</field>
23+
</record>
24+
</data>
25+
</odoo>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-11-09 14:35+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-11-09 14:35+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-11-09 14:35+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-11-09 14:35+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Translations template for PROJECT.
2+
# Copyright (C) 2025 ORGANIZATION
3+
# This file is distributed under the same license as the PROJECT project.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PROJECT VERSION\n"
10+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11+
"POT-Creation-Date: 2025-11-09 14:35+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=utf-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Generated-By: Babel 2.17.0\n"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
from . import product_product

0 commit comments

Comments
 (0)