Skip to content

Conversation

@xaviedoanhduy
Copy link
Contributor

Refactored Test Logic (Immediate Production Removal):

  • Removed the finish_production() helper method and simplified the flow to call button_mark_done() directly.
  • Removed the mrp.immediate.production wizard in commit odoo/odoo@7f6abb71. The button_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 (mo2 case):

  • Explicitly passed input duration parameters to _create_production_with_workorders in the mo2 test case.
  • Rationale: Due to the automatic execution of _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 validating assertNotEqual(partial_input, expected).

Field Renaming:

  • Replaced date_planned_start with date_start to align with version 18.0 changes where workorder and production scheduled/effective dates have been merged/refactored., see: https://github.com/odoo/odoo/pull/110550

Kit/Phantom BoM Logic in Tests:

  • Updated setUpClass to explicitly set the BoM type to "normal".
  • Reason: introduced the _check_kits() method, which enforces stricter validation preventing direct stock.quant updates for Kit (Phantom) products. The previous test data relied on a Phantom BoM which caused UserError during the necessary stock moves for the test setup, see: https://github.com/odoo/odoo/pull/161020

@xaviedoanhduy xaviedoanhduy mentioned this pull request Dec 3, 2025
33 tasks
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.

7 participants