[DOC] Actualizar documentación y instrucciones con cambios recientes (v18.0.1.3.1)
- [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
This commit is contained in:
parent
ed048c85eb
commit
fee8ec9c45
5 changed files with 374 additions and 33 deletions
|
|
@ -21,29 +21,19 @@ Adds a "Main Vendor" field to products that automatically tracks the primary sup
|
|||
|
||||
### Fields Added
|
||||
|
||||
- `default_supplier_id` (Many2one → res.partner, computed, stored)
|
||||
- `main_seller_id` (Many2one → res.partner, computed, stored)
|
||||
- The main vendor for this product
|
||||
- Computed from `seller_ids` with lowest sequence
|
||||
- Stored for performance
|
||||
- Searchable
|
||||
|
||||
- `default_supplier_ref` (Char, related to `default_supplier_id.ref`)
|
||||
- The supplier's reference code
|
||||
- Readonly
|
||||
- Searchable and filterable
|
||||
|
||||
### Computation Logic
|
||||
|
||||
The main vendor is determined by:
|
||||
1. Looking at all supplierinfo records (`seller_ids`)
|
||||
2. Filtering for valid suppliers (not companies)
|
||||
2. Filtering for valid suppliers (active partners)
|
||||
3. Selecting the one with the **lowest sequence** number
|
||||
4. If no sequence, uses the first one
|
||||
|
||||
### Migration Hook
|
||||
|
||||
Includes `pre_init_hook` that:
|
||||
- Populates `default_supplier_id` on existing products during installation
|
||||
- Ensures data consistency from the start
|
||||
4. If no suppliers, returns empty
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
|
@ -57,6 +47,8 @@ docker-compose exec odoo odoo -d odoo -u product_main_seller --stop-after-init
|
|||
|
||||
## Usage
|
||||
|
||||
## Usage
|
||||
|
||||
### Viewing Main Vendor
|
||||
|
||||
1. Open a product form (Products > Products > [Product])
|
||||
|
|
@ -76,28 +68,17 @@ To change the main vendor:
|
|||
```python
|
||||
# Find all products from a specific vendor
|
||||
products = self.env['product.template'].search([
|
||||
('default_supplier_id', '=', vendor_id)
|
||||
('main_seller_id', '=', vendor_id)
|
||||
])
|
||||
```
|
||||
|
||||
## OCA Source
|
||||
|
||||
- **Repository**: [purchase-workflow](https://github.com/OCA/purchase-workflow)
|
||||
- **Original Author**: GRAP
|
||||
- **Maintainers**: legalsylvain, quentinDupont
|
||||
- **License**: AGPL-3
|
||||
|
||||
## Modifications for Kidekoop
|
||||
|
||||
None - Used as-is from OCA.
|
||||
|
||||
## Use Cases in Kidekoop
|
||||
|
||||
This module is critical for:
|
||||
- `product_price_category_supplier`: Bulk updating products by main vendor
|
||||
- Purchase order management
|
||||
- Vendor performance analysis
|
||||
- Purchase order management
|
||||
- Inventory planning by supplier
|
||||
- Default supplier selection in purchase workflows
|
||||
|
||||
## Views Modified
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue