Skip to content

[FW][FIX] mrp: reservation rounding for under-consumption backorders#144620

Closed
fw-bot wants to merge 1 commit intoodoo:17.0from
odoo-dev:17.0-16.0-mrp-fix-underconsumption-split-unreserve-wama-xSGL-fw
Closed

[FW][FIX] mrp: reservation rounding for under-consumption backorders#144620
fw-bot wants to merge 1 commit intoodoo:17.0from
odoo-dev:17.0-16.0-mrp-fix-underconsumption-split-unreserve-wama-xSGL-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Contributor

@fw-bot fw-bot commented Dec 1, 2023

Steps to reproduce:

  1. Create a BoM with a component of 1 quantity
  2. Create a manufacturing order with this BoM
  3. Set the quantity to produce to 5 and confirm
  4. Set the producing quantity to 3.1
  5. Set the quantity done for the raw material to 3.09
  6. Mark the MO as done and create a backorder
  7. Click 'Unreserve' on the backorder
  8. 'It is not possible to unreserve more products of ...'

Before this commit:

_compute_quantity is called with the default rounding method, rounding quantity UP, which introduces reservation inconsistencies.

After this commit:

_compute_quantity rounds with the HALF-UP method, preventing rounding errors.
Also, use the correct UoM in float comparisons.

opw-3601737

Forward-Port-Of: #144176

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Dec 1, 2023

Pull request status dashboard.

@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented Dec 1, 2023

@mwath @clesgow cherrypicking of pull request #144176 failed.

stdout:

Auto-merging addons/mrp/models/mrp_production.py
CONFLICT (content): Merge conflict in addons/mrp/models/mrp_production.py
Auto-merging addons/mrp/tests/test_backorder.py

stderr:

17:36:00.662901 git.c:463               trace: built-in: git cherry-pick 18b12214da978ee43ec6ed1dc828197acb08ad5c
error: could not apply 18b12214da97... [FIX] mrp: reservation rounding for under-consumption backorders
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Dec 1, 2023
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Dec 1, 2023
Steps to reproduce:
1. Create a BoM with a component of 1 quantity
2. Create a manufacturing order with this BoM
3. Set the quantity to produce to 5 and confirm
4. Set the producing quantity to 3.1
5. Set the quantity done for the raw material to 3.09
6. Mark the MO as done and create a backorder
7. Click 'Unreserve' on the backorder
8. 'It is not possible to unreserve more products of ...'

Before this commit:
`_compute_quantity` is called with the default rounding method,
rounding quantity UP, which introduces reservation inconsistencies.

After this commit:
`_compute_quantity` rounds with the HALF-UP method, preventing
rounding errors.
Also, use the correct UoM in float comparisons.

opw-3601737

X-original-commit: f6c15e1
@mwath mwath force-pushed the 17.0-16.0-mrp-fix-underconsumption-split-unreserve-wama-xSGL-fw branch from b92d152 to d2985e4 Compare December 4, 2023 10:52
@mwath
Copy link
Copy Markdown
Contributor

mwath commented Dec 5, 2023

robodoo r+

@robodoo robodoo closed this in 769e1ce Dec 5, 2023
@mwath mwath deleted the 17.0-16.0-mrp-fix-underconsumption-split-unreserve-wama-xSGL-fw branch December 5, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants