Skip to content

[16.0][ADD] repair_preparation#119

Open
sbejaoui wants to merge 6 commits intoOCA:16.0from
acsone:16.0-repair_preparation-sbj
Open

[16.0][ADD] repair_preparation#119
sbejaoui wants to merge 6 commits intoOCA:16.0from
acsone:16.0-repair_preparation-sbj

Conversation

@sbejaoui
Copy link

The repair module consumes spare parts at the end of the repair without considering the qunatity reservation. the more natural flow is to have a staging step to bring and reserve parts before the repair begins, improving planning and reducing delays at the workbench.

This addon introduces a Preparation flow:

  • On Confirm (validate) of the repair, a procurement is run procurement for all eligible Add lines

  • When a repair line is created/edited while the repair is Under Repair:

    • If any linked move is Done → editing raises a validation error
    • Otherwise, linked moves are canceled and procurement is re-run for the updated lines
  • Finishing a repair is blocked if:

    • There are consumed lines but no preparation pickings, or
    • Preparation pickings exist but are not done

cc/ @lmignon , @rousseldenis

@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch 2 times, most recently from d39f316 to 495a3ee Compare August 22, 2025 11:05
@sbejaoui sbejaoui changed the title [WIP][16.0][ADD] repair_preparation [16.0][ADD] repair_preparation Aug 22, 2025
@rousseldenis rousseldenis added this to the 16.0 milestone Aug 22, 2025
@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch from 495a3ee to 6e69cb0 Compare August 22, 2025 11:11
Copy link

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some comments

@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch 2 times, most recently from 1de4451 to e822aa4 Compare August 22, 2025 13:09
@sbejaoui sbejaoui requested a review from rousseldenis August 22, 2025 13:11
@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch from 5ff413b to bb3f1d4 Compare September 1, 2025 11:14
"because some linked moves are already done.\n"
"Repair: %(repair)s\nLines: %(lines)s"
)
% {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use translation function arguments instead.

if not self.preparation_group_id:
self.preparation_group_id = self.env["procurement.group"].create(
{
"name": _("Preparation for") + self.name,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": _("Preparation for") + self.name,
"name": _("Preparation for ") + self.name,

return operations.filtered(
lambda line: line.type == "add"
and line.product_id
and line.product_uom_qty > 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of float_compare() ?

@github-actions
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 15, 2026
@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch from 03ee39f to ecaef28 Compare February 25, 2026 11:37
@sbejaoui sbejaoui force-pushed the 16.0-repair_preparation-sbj branch from ecaef28 to a9a9c81 Compare February 25, 2026 13:47
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants