[ADD] website_sale_aplicoop: Supplier blacklist feature for group orders

- Add excluded_supplier_ids field for supplier exclusion
- Filter products by main_seller_id (from product_main_seller addon)
- Blacklist has absolute priority over all inclusion sources
- Products with blacklisted main supplier never appear in orders
- Update _get_products_for_group_order() with supplier blacklist logic
- Add excluded_supplier_ids to 'Productos Excluidos' section in form view
- Add comprehensive test suite (TestSupplierBlacklist class with 9 tests):
  * Test exclusion by main_seller_id
  * Test multiple supplier exclusion
  * Test products without main seller not affected
  * Test blacklist with direct product inclusion
  * Test blacklist priority over supplier inclusion
  * Test combined product and supplier blacklist
  * Test available_products_count with supplier blacklist
- Add Spanish and Euskera translations
- Update available_products_count computation to include excluded_supplier_ids
- Version bump to 18.0.1.5.0

Use case: Exclude all products from specific supplier (e.g., temporary unavailability)
Example: Category with 100 products, exclude supplier X → all products from X excluded
Workflow: Bulk inclusion via categories + supplier-level exclusion + product-level exclusion
This commit is contained in:
snt 2026-02-22 21:35:40 +01:00
parent 75ebb7b907
commit d90f2cdc61
7 changed files with 371 additions and 4 deletions

View file

@ -1,5 +1,42 @@
# Changelog - Website Sale Aplicoop
## [18.0.1.5.0] - 2026-02-22
### Added
- **Supplier Blacklist Feature**: New exclusion system by supplier for group orders
- New field: `excluded_supplier_ids` (Many2many to res.partner)
- Filters products by `main_seller_id` (from product_main_seller addon)
- Blacklist has absolute priority over all inclusion sources
- Products whose main supplier is blacklisted never appear
- Comprehensive test suite in `test_product_discovery.py` (TestSupplierBlacklist class with 9 tests)
### Changed
- **Product Discovery Logic**: Extended to filter by supplier blacklist
- `_get_products_for_group_order()` now applies `excluded_supplier_ids` filter
- Products with `main_seller_id` in excluded_supplier_ids are filtered out
- `_compute_available_products_count()` now depends on `excluded_supplier_ids`
- Detailed logging for excluded suppliers and affected products
- **UI Updates**: "Productos Excluidos" section now includes both:
- `excluded_supplier_ids`: Blacklist suppliers
- `excluded_product_ids`: Blacklist specific products
### Technical Details
- New M2M relation: `group_order_excluded_supplier_rel`
- Filter logic: `products.filtered(lambda p: p.product_tmpl_id.main_seller_id not in excluded_supplier_ids)`
- Works in combination with product blacklist (both filters apply)
- Uses `main_seller_id` from product_main_seller addon (NOT default_supplier_id)
### Use Case
- Admin wants to exclude all products from a specific supplier (e.g., temporary unavailability)
- Add category with 100 products → add problematic supplier to excluded_supplier_ids
- Result: All products from that supplier are excluded, even if directly included
- Combined workflow: Category inclusion + supplier exclusion + individual product exclusion
## [18.0.1.4.0] - 2026-02-22
### Added