- [FIX] Actualizar copilot-instructions.md con nuevas secciones: * QWeb Template Best Practices (patrón crítico para templates complejos) * Eskaera System mejorado con info de lazy loading v18.0.1.3.0+ * QWeb Template Errors en Common Issues & Solutions * Recent Changes Summary (actualizado a 2026-02-18) - [ADD] Nuevo documento docs/RECENT_CHANGES.md: * Timeline completo de cambios (Feb 2-18, 2026) * 4 secciones principales de cambios documentados * Impacto y acciones requeridas por developers * Referencias cruzadas a documentación técnica - [UPD] README.md principal: * website_sale_aplicoop actualizado a v18.0.1.3.1 * Mención de fixes críticos de v18.0.1.3.1 * Referencias a FINAL_SOLUTION_SUMMARY.md - [REF] product_main_seller/README.md: * Removidas referencias obsoletas a default_supplier_id * Documentación actualizada para usar main_seller_id * Simplificada sección de Computation Logic - [UPD] docs/README.md: * Nueva sección "Cambios Recientes" * Reorganizado índice de documentación de template fixes * Mejorada estructura de secciones de troubleshooting Cambios Documentados: ✅ Refactoring product_main_seller (18 Feb) - Removido campo alias ✅ v18.0.1.3.1 Fixes (16 Feb) - Date calculations y template rendering ✅ v18.0.1.3.0 Lazy Loading (12 Feb) - Performance improvement 95% ✅ Template Logic Refactoring (Feb 2-16) - QWeb best practices +438 líneas de documentación nueva/actualizada |
||
|---|---|---|
| .. | ||
| i18n | ||
| models | ||
| readme | ||
| static/description | ||
| tests | ||
| views | ||
| __init__.py | ||
| __manifest__.py | ||
| hooks.py | ||
| pyproject.toml | ||
| README.md | ||
| README.rst | ||
Product Main Seller
Summary
Adds a "Main Vendor" field to products that automatically tracks the primary supplier based on supplierinfo sequence.
Features
- Automatic Main Vendor: Computed field showing the primary supplier
- Based on Sequence: Uses the supplierinfo with the lowest sequence number
- Visible in Views: Shows in product form and tree views
- Searchable: Can search and filter products by main vendor
- Related Fields: Access to vendor name and reference
Technical Details
Models Extended
product.template: Main product templateproduct.product: Product variants
Fields Added
main_seller_id(Many2one → res.partner, computed, stored)- The main vendor for this product
- Computed from
seller_idswith lowest sequence - Stored for performance
- Searchable and filterable
Computation Logic
The main vendor is determined by:
- Looking at all supplierinfo records (
seller_ids) - Filtering for valid suppliers (active partners)
- Selecting the one with the lowest sequence number
- If no suppliers, returns empty
Dependencies
purchase(Odoo core)
Installation
docker-compose exec odoo odoo -d odoo -u product_main_seller --stop-after-init
Usage
Usage
Viewing Main Vendor
- Open a product form (Products > Products > [Product])
- See "Main Vendor" field (usually in Purchase tab)
- Field is automatically computed from vendor list
Changing Main Vendor
To change the main vendor:
- Go to product form > Purchase tab
- Edit the vendor list (
seller_ids) - Change the sequence numbers (lower = more priority)
- Save - the "Main Vendor" will update automatically
Searching by Vendor
# Find all products from a specific vendor
products = self.env['product.template'].search([
('main_seller_id', '=', vendor_id)
])
Use Cases in Kidekoop
This module is critical for:
- Vendor performance analysis
- Purchase order management
- Inventory planning by supplier
- Default supplier selection in purchase workflows
Views Modified
- Product Template Form View
- Product Template Tree View
- Product Variant Form View
Translations
- ✅ Spanish (es)
- ✅ Euskera (eu)
Located in i18n/ directory.
Version: 18.0.1.0.0 Category: Purchase License: AGPL-3