[FIX] website_sale_aplicoop: Critical date calculation fixes (v18.0.1.3.1)
- Fixed _compute_cutoff_date logic: Changed days_ahead <= 0 to days_ahead < 0 to allow cutoff_date same day as today
- Enabled store=True for delivery_date field to persist calculated values and enable database filtering
- Added constraint _check_cutoff_before_pickup to validate pickup_day >= cutoff_day in weekly orders
- Added @api.onchange methods for immediate UI feedback when changing cutoff_day or pickup_day
- Created daily cron job _cron_update_dates to automatically recalculate dates for active orders
- Added 'Calculated Dates' section in form view showing readonly cutoff_date, pickup_date, delivery_date
- Added 6 regression tests with @tagged('post_install', 'date_calculations')
- Updated documentation with comprehensive changelog
This is a more robust fix than v18.0.1.2.0, addressing edge cases in date calculations.
This commit is contained in:
parent
c70de71cff
commit
8b0a402ccf
6 changed files with 489 additions and 120 deletions
|
|
@ -240,6 +240,29 @@ python -m pytest website_sale_aplicoop/tests/ -v
|
|||
|
||||
## Changelog
|
||||
|
||||
### 18.0.1.3.1 (2026-02-18)
|
||||
- **Date Calculation Fixes (Critical)**:
|
||||
- Fixed `_compute_cutoff_date` logic: Changed `days_ahead <= 0` to `days_ahead < 0` to allow cutoff_date to be the same day as today
|
||||
- Enabled `store=True` for `delivery_date` field to persist calculated values and enable database filtering
|
||||
- Added constraint `_check_cutoff_before_pickup` to validate that pickup_day >= cutoff_day in weekly orders
|
||||
- Added `@api.onchange` methods for immediate UI feedback when changing cutoff_day or pickup_day
|
||||
- **Automatic Date Updates**:
|
||||
- Created daily cron job `_cron_update_dates` to automatically recalculate dates for active orders
|
||||
- Ensures computed dates stay current as time passes
|
||||
- **UI Improvements**:
|
||||
- Added "Calculated Dates" section in form view showing readonly cutoff_date, pickup_date, and delivery_date
|
||||
- Improved visibility of automatically calculated dates for administrators
|
||||
- **Testing**:
|
||||
- Added 6 regression tests with `@tagged('post_install', 'date_calculations')`:
|
||||
- `test_cutoff_same_day_as_today_bug_fix`: Validates cutoff can be today
|
||||
- `test_delivery_date_stored_correctly`: Ensures delivery_date persistence
|
||||
- `test_constraint_cutoff_before_pickup_invalid`: Tests invalid configurations are rejected
|
||||
- `test_constraint_cutoff_before_pickup_valid`: Tests valid configurations work
|
||||
- `test_all_weekday_combinations_consistency`: Tests all 49 date combinations
|
||||
- `test_cron_update_dates_executes`: Validates cron job execution
|
||||
- **Documentation**:
|
||||
- Documented that this is a more robust fix than v18.0.1.2.0, addressing edge cases in date calculations
|
||||
|
||||
### 18.0.1.3.0 (2026-02-16)
|
||||
- **Performance**: Lazy loading of products for faster page loads
|
||||
- Configurable product pagination (default: 20 per page)
|
||||
|
|
@ -306,7 +329,7 @@ For issues, feature requests, or contributions:
|
|||
|
||||
---
|
||||
|
||||
**Version:** 18.0.1.2.0
|
||||
**Version:** 18.0.1.3.1
|
||||
**Odoo:** 18.0+
|
||||
**License:** AGPL-3
|
||||
**Maintainer:** Criptomart SL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue