[16.0][REF] repair_refurbish: Reimplementation of refurbishment logic#164
Open
nicolas-delbovier-acsone wants to merge 2 commits into
Open
[16.0][REF] repair_refurbish: Reimplementation of refurbishment logic#164nicolas-delbovier-acsone wants to merge 2 commits into
nicolas-delbovier-acsone wants to merge 2 commits into
Conversation
The previous implementation was brittle, relying on complex onchanges
and manual field synchronization that could fail when used in
combination with other modules (like repair_type).
This refactor streamlines the workflow while preserving the original
functional intent defined in USAGE.rst.
Key Changes:
- Logic: Moved refurbishment logic from UI-driven onchanges to a more
robust backend approach (computed field).
- Data: Introduced a dedicated 'Refurbish Scrap' location to isolate
waste reporting.
- Simplified Config: Removed `property_stock_refurbish` on product
templates. The module now uses the global virtual refurbish locations
by default, reducing configuration overhead.
- UI/UX:
- Added a `boolean_toggle` for 'To Refurbish' at the top of the form.
- Grouped refurbishment fields into a dedicated section.
- Clean Code:
- Removed unnecessary inheritance on `repair.line` and `stock.move.line`.
- Used `Command` methodology for move line creation.
- Switched to `api.depends` (computed stored) for the refurbished
product to ensure data integrity.
- Testing: Complete rewrite of tests to use `setUpClass`. Tests now
simulate realistic workflows and no longer rely on setting values in
invisible fields that would be inaccessible to users through UI.
This refactor also fixes the CI/CD pipeline failures that were
affecting other PRs in the repository due to the broken test suite
in this module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is in following of this comment: #119 (comment)
The previous implementation was brittle, relying on complex onchanges and manual field synchronization that could fail when used in combination with other modules (like repair_type).
This refactor streamlines the workflow while preserving the original functional intent defined in
USAGE.rst.Key Changes:
property_stock_refurbishon product templates. The module now uses the global virtual refurbish locations by default, reducing configuration overhead.boolean_togglefor 'To Refurbish' at the top of the form.repair.lineandstock.move.line.Commandmethodology for move line creation.api.depends(computed stored) for the refurbished product to ensure data integrity.setUpClass. Tests now simulate realistic workflows and no longer rely on setting values in invisible fields that would be inaccessible to users through UI.This refactor also fixes the CI/CD pipeline failures that were affecting other PRs in the repository due to the broken test suite in this module.
UI upgrade