Commit graph

227 commits

Author SHA1 Message Date
snt
6d94484710 [FIX] product_sale_price_from_pricelist: migrate data and add diagnostic tests
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
2026-02-12 19:51:23 +01:00
snt
f3a258766b [FIX] product_sale_price_from_pricelist: use write() for price update
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.
2026-02-12 19:33:33 +01:00
snt
b916779a67 [FIX] product_sale_price_from_pricelist: tests for Odoo 18 compatibility
- 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
2026-02-12 19:29:47 +01:00
snt
55811d54b1 [FIX] product_sale_price_from_pricelist: Actualizar tests para Odoo 18
- 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
2026-02-12 19:23:29 +01:00
snt
fd83d31188 [FIX] product_sale_price_from_pricelist: Properly handle template vs variant IDs
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
2026-02-12 18:52:56 +01:00
snt
4b78dc4447 [FIX] product_sale_price_from_pricelist: Handle product.template in _compute_price_rule
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,))
2026-02-12 18:48:13 +01:00
snt
70ed972e23 [FIX] product_sale_price_from_pricelist: Add last_purchase_price field to template
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.
2026-02-12 18:45:32 +01:00
snt
c308d538a3 cosmetic 2026-02-12 18:33:57 +01:00
snt
f5a689bcc8 [REF] product_sale_price_from_pricelist: Move fields to product.product
- 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.
2026-02-12 18:18:44 +01:00
snt
4207afbc3f update pylint10, corrije authors manifest 2026-02-12 17:15:33 +01:00
snt
0889cdfc3a [IMP] website_sale_aplicoop: Add product origin fields to product cards
- 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
2026-02-12 16:40:01 +01:00
snt
b10ba1fc15 [DOC] all: Reorganize and consolidate project documentation
- 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.
2026-02-12 16:25:49 +01:00
snt
2a480b74bb Add update price button with notification to product views
- 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
2026-02-11 21:04:18 +01:00
snt
4d23e98f7b Revertir cambio: eliminar cálculo duplicado de impuestos
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.
2026-02-11 19:54:28 +01:00
snt
3cb0af6a7b [FIX] product_sale_price_from_pricelist: Fix view xpath to use group_standard_price anchor 2026-02-11 18:37:34 +01:00
snt
ec9f5a572c [FIX] product_sale_price_from_pricelist: Fix view syntax for Odoo 18
- 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
2026-02-11 17:26:14 +01:00
snt
fe137dc265 build: configurar herramientas de verificación OCA
- 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)
2026-02-11 16:09:41 +01:00
snt
5b9c6e3211 docker test files 2026-02-11 15:33:31 +01:00
snt
370c8ca66a import desde el repo de kidekoop 2026-02-11 15:33:01 +01:00
snt
7cff89e418 Aplicoop desde el repo de kidekoop 2026-02-11 15:32:11 +01:00
snt
69917d1ec2 fix form 2026-02-11 02:55:10 +01:00
snt
39eb9608dc borrados addons no portados 2026-02-11 02:00:49 +01:00
snt
80c2617c40 [FIX] product_sale_price_from_pricelist: Fix Odoo 18 compatibility issues
- 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
2026-02-11 01:57:54 +01:00
snt
e27cacd65b [18.0][MIG] product_sale_price_from_pricelist: Port to Odoo 18.0
- 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
2026-02-11 01:06:00 +01:00
snt
1bcc31b810 [ADD] product_sale_price_from_pricelist: módulo para calcular precio de venta desde tarifa 2026-02-11 00:34:05 +01:00
snt
123aabb775 [18.0][MIG] account_invoice_triple_discount_readonly: Port to Odoo 18.0
* 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
2026-02-10 23:22:50 +01:00
67554c95f5 website_search_products: fix redirect 2026-02-04 09:28:51 +01:00
46634fcdc0 website_search_products: fix warnings 2026-02-03 18:55:55 +01:00
f1a3a75988 LaOsaCoop/Odoo16#109 migrated website_search_products 2026-02-03 18:40:48 +01:00
26dbe222dd add READMEs 2025-12-19 09:22:33 +01:00
d43991240a product_sale_price_from_pricelist: remove redundant filter 2025-12-19 09:22:00 +01:00
d5342c73fb product_sale_price_from_pricelist: support uom_po_id != uom_id 2025-12-11 13:50:29 +01:00
38d1bdec3f CriptoMart/red-supermercados-coop#22 stock_inventory_product_exhausted: fix unlink quants from archived products 2025-12-11 11:54:01 +01:00
9d426ff176 Criptomart/red-supermercados-coop#6 stock_valuation_layer_category_groupby: add group_by parent categories 2025-12-10 12:57:05 +01:00
51a53f54ba FoodcoopBCN/foodcoopbcn#162 add website_sale_cart_line_subtotal 2025-12-09 13:05:45 +01:00
90a0e989c8 pos_order_backend_receipt: fix string lang 2025-12-09 11:38:15 +01:00
19af717773 Criptomart/red-supermercados-coop#6 add stock_valuation_layer_category_groupby 2025-12-04 18:28:18 +01:00
18f98defeb Criptomart/red-supermercados-coop#5 add purchase_invoice_subtotal_taxes 2025-12-04 17:56:31 +01:00
9daf707f40 Criptomart/red-supermercados-coop#18 stock_inventory_product_exhausted: allow unlink empty stock.quants for archived products 2025-12-04 17:15:36 +01:00
6b1b032101 Criptomart/red-supermercados-coop#4 add pos_full_refund from OCA/pos/pull/1458 2025-12-04 14:03:12 +01:00
5c213a3d6a Criptomart/red-supermercados-coop#17 add account_invoice_triple_discount_readonly: fix write discount2 and dicount3 columns. Make discount (total) readonly 2025-12-04 14:01:50 +01:00
7df39dbda8 product_sale_price_from_pricelist: don't update list_price when last_purchase_price_compute_type == manual_update. Add fields to tree product view 2025-11-28 09:46:37 +01:00
969cc9e9f5 add l10n_es_pos_receipt_hide_customer_info 2025-11-20 19:10:58 +01:00
29249a41cb Criptomart/red-supermercados-coop#1 purchase_order_product_recommendation_supermarket: fix add new productos without stock to purchase orders 2025-10-29 13:03:59 +01:00
812fe9bef3 stock_inventory_product_exhausted: add translations 2025-10-17 11:53:29 +02:00
fc3b037436 Arbore/arbore#155 add supplier name to purchase order lines in a separate column 2025-10-17 11:28:11 +02:00
8049272620 pos_order_backend_receipt: add pricelist 2025-10-14 11:50:08 +02:00
7ad70064a7 Criptomart/red-supermercados-coop#4 add pos_order_backend_receipt 2025-10-09 10:09:32 +02:00
6aec5669be add pos_cashdro_rounding 2025-10-07 16:38:22 +02:00
91641c7c88 Criptomart/red-supermercados-coop#2 stock_inventory_category_concurrency: store product_category_id in stock.quants. Add search and group_by categories 2025-10-07 11:33:25 +02:00