Skip to content

Commit 0d4253f

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 98fe3d6 commit 0d4253f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sale_product_supplierinfo_search/tests/test_sale_product_supplierinfo_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setUp(self):
1414
{
1515
"name": "Test Product A",
1616
"default_code": "TEST-A",
17-
"type": "product",
17+
"detailed_type": "product",
1818
}
1919
)
2020
self.supplier = self.Supplier.create({"name": "Test Supplier"})
@@ -31,8 +31,8 @@ def setUp(self):
3131
self.product_test_b = self.ProductProduct.create(
3232
{
3333
"name": "Test Product B",
34-
"default_code": "TEST-B-NAME", # Name also matches a search for 'TEST-B'
35-
"type": "product",
34+
"default_code": "TEST-B-NAME",
35+
"detailed_type": "product",
3636
}
3737
)
3838
self.supplier_info_b = self.SupplierInfo.create(

0 commit comments

Comments
 (0)