Migration (18.0.2.1.0):
- Migrate price fields from product.template to product.product
- Fields were previously stored in template during initial refactoring
- Data now properly located in product variant storage
Changes:
- Add migration pre-migrate.py to handle data migration automatically
- Add test_theoretical_price.py with comprehensive diagnostic tests
- Add test_full_flow_updates_theoretical_price to verify complete workflow
- Enhance stock_move.py with additional debug logging to diagnose issues
- Update __manifest__.py version to 18.0.2.1.0
- Update tests/__init__.py to include new test module
Fixes:
- last_purchase_price_received was stored in product.template but read from product.product
- Causes theoretical price calculation to show 0.0 instead of correct value
- Migration script copies data to correct model with company_dependent JSON format
Use write() instead of direct assignment to ensure last_purchase_price_received
is persisted before computing theoretical price. The with_company() creates a
new recordset and direct assignment may not propagate correctly.
- Write field values to product.product variants directly in tests
- Call price_compute on variant (product.product) not template
- Adjust expected prices to NOT include tax (calculated on sales)
- Clear taxes explicitly in no-tax test to avoid inheritance
- Fix floating point precision issue in rounding test
- Add taxes and skip logic to UoM conversion test
- All 32 tests now pass
- Cambiar parámetro qty= a quantity= en llamadas a _compute_price_rule
- Eliminar type/detailed_type de product.product creates
- Añadir campo name a purchase.order.line
- Agregar método _compute_theoritical_price en template
- Crear helpers para leer precios teóricos desde variante
- Corregir variables no usadas y nombres indefinidos
Instead of converting templates to variants before calling super(), check
the model type when processing results. If working with product.template,
get the variant from the template using browse(). This preserves the
expected ID mapping in the result dictionary and avoids lambda variable
binding issues.
Fixes: KeyError: 9 in pricelist computation
Added check to ensure _compute_price_rule always works with product.product.
When product.template records are passed, convert them to their variants
before processing. This prevents MissingError when browsing product.product
with template IDs.
Fixes: Record does not exist or has been deleted (Record: product.product(22,))
Added last_purchase_price computed field in product.template as an alias
to last_purchase_price_received. This field is required for compatibility
with Odoo's standard pricelist system which accesses template['last_purchase_price']
during price computation.
Fixes KeyError: 'last_purchase_price' in website shop controller.
- Moved all main fields from product.template to product.product
- Created computed fields in product.template with inverse/search methods
- Moved business logic (_compute_theoritical_price, action_update_list_price) to product.product
- Updated stock_move.py to work directly with product.product
- Fixed searchable field warnings by using compute/inverse/search pattern
- Fixed linting issues: removed unused imports, added return statement, use self.env._() with named placeholders
- Added migration script and CHANGELOG
- Version bumped to 18.0.2.0.0
This fixes pricelist report generation issues and follows Odoo best practices
for product variant handling.
- Add product_origin dependency to show country/state of origin
- Display country_id and state_id fields in product cards with map marker icon
- Show only populated fields (conditional rendering)
- Fields appear after supplier info in eskaera shop template
- Country names auto-translate based on user language (state names do not)
- Format: 'State, Country' or just 'Country' if no state
- Create .github/copilot-instructions.md with global development guidelines
- Add comprehensive README.md at project root with quick start guide
- Create docs/ directory for technical documentation
- Move installation and linter docs to docs/
- Add docs/TRANSLATIONS.md with complete translation system guide
- Create README.md for OCA modified addons (product_origin, product_get_price_helper, product_main_seller)
- Document translation best practices (no _() in field definitions)
- Add references between all documentation files
- Clean up project root by moving technical docs to docs/
All documentation now properly references addon-specific READMEs for detailed architecture and implementation.
- Add action_update_list_price button in form and list views
- Button shows only when compute type is not manual_update
- Return notification message with update results
- Invalidate cache to refresh UI automatically
- Show updated products with old and new prices
- Display skipped products with manual update mode
El método _get_price() del addon OCA ya maneja correctamente los impuestos
según la configuración de Odoo. El cálculo adicional con compute_all() estaba
duplicando los impuestos cuando price_include estaba activado.
Cambios:
- Eliminado método _compute_price_with_taxes()
- Revertido eskaera_shop() para usar directamente _get_price()
- Revertido add_to_eskaera_cart() para usar directamente _get_price()
El precio mostrado ahora respeta la configuración de impuestos de Odoo
sin duplicación.
- Replace attrs syntax with new invisible attribute format
- Fix settings view inheritance to use sale.res_config_settings_view_form
- Add configuration setting in Sales > Pricing section
- Place automatic price pricelist setting after standard pricelist config
- Instalar pre-commit con 25 hooks configurados
- Configurar black 26.1.0 para formateo de código Python
- Configurar isort 7.0.0 para ordenación de imports
- Configurar flake8 7.3.0 con flake8-bugbear
- Configurar pylint 3.1.1 con pylint-odoo 9.1.2
- Añadir autoflake y pyupgrade para mejoras automáticas
- Configurar prettier para formateo de XML/JSON/YAML
- Crear .editorconfig para consistencia de editor
- Crear Makefile con comandos útiles
- Crear check_addon.sh para verificación rápida de addons
- Actualizar configuración de VS Code con extensiones recomendadas
- Añadir documentación completa de uso
- Aplicar formateo automático a archivos existentes
- Deshabilitar setuptools-odoo (no soporta Odoo 18.0 aún)
- Deshabilitar fix-encoding-pragma (obsoleto, usar pyupgrade)
- Fix _compute_price_rule: use 'quantity' positional parameter instead of 'qty'
- Fix stock_move: use 'quantity' instead of 'quantity_done' (Odoo 18 change)
- Fix _get_price return value: extract 'value' key directly from dict
- Add last_purchase_price related field in product.product for pricelist base
- Remove company_dependent+required conflict (use only company_dependent)
- Calculate list_price without taxes (taxes applied automatically on sales)
- Add comprehensive debug logging for price calculations
- Add action_update_list_price to compute theoretical price before updating
- Add 3 new tests for purchase price validation and zero price handling
- Fix _compute_price_rule to handle multiple tax amounts correctly
- Update manifest version to 18.0.1.0.0
- Update view inheritance to use Odoo 18 <block>/<setting> structure
- Update pricelist models for Odoo 18 API changes (qty parameter)
- Remove required=True from company_dependent field
- Add comprehensive test suite (33 tests)
- Tests cover: pricelist calculations, stock moves, product templates, and config settings
* Update module version to 18.0.1.0.0
* Remove view modifications as they are handled by parent modules
* Add comprehensive test suite (34 tests):
- Test triple discount mixin write() method behavior
- Test account.move.line with triple discounts
- Test purchase.order.line with triple discounts
* Add oca_dependencies.txt with required OCA repositories
* Fix write() method to handle explicit discounts correctly