4.7 KiB
4.7 KiB
Backlog - Market Price Import
Scope: code changes related only to BR-PT-004 - Market Price Import.
PT-BL-001 - Enforce uniqueness at model level
- Status: done
- Implementation commit:
eaae2e5 - Priority: high
- Source: business rules/market-price-import.md
- Requirement: enforce uniqueness of
(price, price_date)at model level without adding a database constraint yet. - Work done:
- added model-level validation on
price.price_value - added Tryton message
price.msg_price_value_unique - added targeted tests for duplicate create and duplicate write validation
- added model-level validation on
- Validation status:
git diff --checkpassed- automated Python tests still need to be run in a working Tryton Python environment
- Expected code impact:
modules/purchase_trade/pricing.py- possibly
modules/price/price_value.pyif the validation belongs on the target model
- Expected tests:
- importing a row for an existing
(price, price_date)skips or updates according toOverwrite existing price - creating/editing duplicate
price.price_valuerecords at model level is rejected if validation is implemented onprice.price_value
- importing a row for an existing
PT-BL-002 - Use locale-aware slash date parsing
- Status: open
- Priority: medium
- Source: business rules/market-price-import.md
- Requirement: prefer the user's/default locale date format for ambiguous slash dates, then fall back to the current parsing order only if no locale preference is available.
- Current behavior:
DD/MM/YYYYis tried beforeMM/DD/YYYY. - Expected code impact:
modules/purchase_trade/pricing.py
- Expected tests:
- slash dates follow the configured/default locale when available
- slash dates keep a deterministic fallback when locale is unavailable
- existing accepted formats still work
PT-BL-003 - Reject missing price_value
- Status: open
- Priority: high
- Source: business rules/market-price-import.md
- Requirement:
price_valueis mandatory for imported rows. Missingprice_valuemust be reported as a row error. - Current behavior: empty
price_valueis imported as an empty value. - Expected code impact:
modules/purchase_trade/pricing.py
- Expected tests:
- missing
price_valueis reported inerrors - missing
high_price,low_price, andopen_priceremain allowed - valid
price_valuestill imports and updates correctly
- missing
PT-BL-004 - Detect duplicate rows inside the same Excel file
- Status: open
- Priority: high
- Source: business rules/market-price-import.md
- Requirement: duplicate rows for the same
(price_index, price_date)inside the same Excel file must be reported as row errors. The duplicate row must not import or update data. - Expected code impact:
modules/purchase_trade/pricing.py
- Expected tests:
- duplicate
(price_index, price_date)rows in the same import produce row errors - first occurrence behavior remains unchanged
- duplicate rows do not overwrite previous imported or updated values
- duplicate
PT-BL-005 - Categorize import result errors
- Status: open
- Priority: medium
- Source: business rules/market-price-import.md
- Requirement: distinguish business validation errors from file, parsing, and technical errors in the import result.
- Current behavior: row errors are grouped under one
Errorssection. - Expected code impact:
modules/purchase_trade/pricing.pymodules/purchase_trade/view/import_prices_result_form.xmlonly if the result display needs more structure
- Expected tests:
- result message separates business validation errors from parsing/technical errors
- invalid workbook and missing required columns remain blocking
UserError - row-level errors still let the import continue
PT-BL-006 - Fix missing default currency on created price index
- Status: open
- Priority: high
- Source bug: BUG-PT-001
- Source rule: business rules/market-price-import.md
- Requirement: when the market price import automatically creates a missing
price.price, the created price index must have default currencyUSD. - Current behavior: the created price index can miss the default currency even though the import specification expects
USD. - Expected code impact:
modules/purchase_trade/pricing.py
- Expected tests:
- automatic price index creation assigns
price_currencyto theUSDcurrency record - if the
USDcurrency record cannot be found, behavior remains aligned with the rule for optional default references
- automatic price index creation assigns