[18.0][MIG] mrp_default_workorder_time: Migration to 18.0 #1672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored Test Logic (Immediate Production Removal):
finish_production()helper method and simplified the flow to callbutton_mark_done()directly.mrp.immediate.productionwizard in commit odoo/odoo@7f6abb71. Thebutton_mark_done()method now automatically triggers_set_quantities()via_auto_production_checks()to auto-fill missing data, making the wizard handling obsolete.Test Logic Refinement (
mo2case):_create_production_with_workordersin themo2test case._set_quantities()mentioned above, leaving the duration empty (0.0) causes version 18 to auto-fill it with the full Expected Duration, causing false negatives in assertions. By injecting a specific partial duration, we create a deterministic state to verify that the module does not override user input when disabled, strictly validatingassertNotEqual(partial_input, expected).Field Renaming:
date_planned_startwithdate_startto align with version 18.0 changes where workorder and production scheduled/effective dates have been merged/refactored., see:https://github.com/odoo/odoo/pull/110550Kit/Phantom BoM Logic in Tests:
setUpClassto explicitly set the BoM type to"normal"._check_kits()method, which enforces stricter validation preventing directstock.quantupdates for Kit (Phantom) products. The previous test data relied on a Phantom BoM which causedUserErrorduring the necessary stock moves for the test setup, see:https://github.com/odoo/odoo/pull/161020