Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] mrp: workorder state not updated on parent MO validation #162200

Open
wants to merge 1 commit into
base: saas-16.3
Choose a base branch
from

Conversation

amoyaux
Copy link
Contributor

@amoyaux amoyaux commented Apr 17, 2024

It happens due to a loop
production reservation_state -> production state -> workorder state -> production reservation_state

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Apr 17, 2024

Pull request status dashboard.

@C3POdoo C3POdoo requested a review from a team April 17, 2024 11:29
@C3POdoo C3POdoo added the RD research & development, internal work label Apr 17, 2024
It happens due to a loop
`production reservation_state` -> `production state` -> `workorder state`
-> `production reservation_state`
@amoyaux amoyaux force-pushed the saas-16.3-reservation-state-wo-arm branch from cb57aaf to 99d5c1d Compare April 17, 2024 15:43
Copy link
Contributor

@clesgow clesgow left a comment

Choose a reason for hiding this comment

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

I wonder if it wouldn't be better to only do what was planned in this forward-port #134711.
Quickly checked the use case (completing the Child MO and see if the Source MO has its own workorders updated) and it seemed to work properly, as it does in 16.0.

Feel free to correct me if I'm wrong, as I didn't dig too much in your fix! 😄

EDIT: Also, as it seems to be a recurring issue since 16.0, a test might be nice to have. 🙂

@@ -2318,7 +2318,7 @@ def test_state_workorders(self):
mo.do_unreserve()

self.assertEqual(list(mo.workorder_ids.mapped("state")), ["waiting", "pending"])

import pudb; pudb.set_trace()
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants