[18.0][MIG] stock_production_lot_warranty#468
[18.0][MIG] stock_production_lot_warranty#468georgiedekker wants to merge 6 commits intoOCA:18.0from
Conversation
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.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
I have found this module while searching for a solution for customer warranty dates in odoo 19. I was just wondering if it makes sense that the warranty date is initially set using the lot creation date (as it is done with an onchange on the product, which basically will trigger the method at creation). I understand that the intention of this module is in fact to specify customer warranty, since it is using the warranty field on the sales tab of the product. But then, wouldn't be most appropriate, based on the common behavior of warranties, that this date is set when selling the product, instead of at lot creation (which will probably be after manufacturing or receiving the product from the supplier). Perhaps what would make more sense is to set the warranty date only when the lot is sold. And if you want to have your warranty date (the one that comes from the supplier) then another field could be created. However, since this module is already used in several versions, I understand we can not change the behavior. So I am not sure how to approach this. Maybe creating a stock_production_lot_warranty_sale with the suggested logic will be fine? What do you think? @osi-scampbell @max3903 @georgiedekker |
|
@MarinaAForgeFlow I'm not actively developing on Odoo at the moment, but I did some conversions of proprietary modules to Odoo 18 and 19 which is why I created this PR, which hasn't found any reception since I created it in August, so I'm not sure that there is any active development in this repository. Happy to be of assistance if that would help you. The chance you describe sounds fair and doable. |
Migrate stock_production_lot_warranty to version 18.0
Related to #425
This PR migrates the
stock_production_lot_warrantymodule from version 15.0 to 18.0.Changes Made
15.0.1.1.0to18.0.1.0.0pyproject.tomlfor build configurationModule Description
This module adds warranty expiration date functionality to stock production lots/serial numbers, automatically calculating the warranty expiration based on product warranty settings.
Testing