Skip to content

[19.0][MIG] stock_production_lot_warranty#526

Closed
MarinaAForgeFlow wants to merge 8 commits intoOCA:19.0from
ForgeFlow:19.0-mig-stock_production_lot_warranty
Closed

[19.0][MIG] stock_production_lot_warranty#526
MarinaAForgeFlow wants to merge 8 commits intoOCA:19.0from
ForgeFlow:19.0-mig-stock_production_lot_warranty

Conversation

@MarinaAForgeFlow
Copy link

Based on #468

Depends on #506

Standard migration from v18 to v19

georgiedekker and others added 8 commits January 16, 2026 16:15
In Odoo 18, the model 'stock.production.lot' has been renamed to 'stock.lot'.
This commit updates all references to use the new model name:
- Updated model inheritance in Python files
- Updated view references from stock.view_production_lot_form to stock.view_lot_form
- Updated test references to use stock.lot instead of stock.production.lot
Fixed the inherited view reference from stock.view_lot_form to
stock.view_production_lot_form which is the correct XML ID in Odoo 18.

The module now successfully installs and works with Odoo 18.
- Replace psycopg2.IntegrityError with ValidationError/ValueError exceptions
- Add mute_logger decorator to suppress SQL error logs in tests
- Add flush_recordset() calls to ensure constraint checks are triggered
- Update test expectations to match Odoo 18 behavior

The tests were failing because Odoo 18 handles database constraints differently,
requiring updates to exception handling in the test cases.
…Odoo 18

- Replace tuple exception handling with try-except blocks
- Odoo 18's assertRaises doesn't accept tuples of exceptions
- Use try-except to handle both ValidationError and IntegrityError
- Fix line length issues for pre-commit compliance

The tests were failing with 'TypeError: issubclass() arg 1 must be a class'
because Odoo 18's test framework doesn't support passing multiple exception
types to assertRaises.
…rmatting

- Replace 'pass' in except blocks with proper assertions
- Use error_raised flag to avoid pylint W8138 warning
- Apply ruff formatting to ensure consistent code style
- All pre-commit checks now pass

This ensures the code meets OCA quality standards and CI requirements.
@MarinaAForgeFlow MarinaAForgeFlow deleted the 19.0-mig-stock_production_lot_warranty branch January 16, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants