Skip to content

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

Closed
fw-bot wants to merge 1 commit intoodoo:masterfrom
odoo-dev:master-16.0-mrp-fix-underconsumption-split-unreserve-wama-dcx0-fw
Closed

[FW][FIX] mrp: reservation rounding for under-consumption backorders#145063
fw-bot wants to merge 1 commit intoodoo:masterfrom
odoo-dev:master-16.0-mrp-fix-underconsumption-split-unreserve-wama-dcx0-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Contributor

@fw-bot fw-bot commented Dec 5, 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: #144620
Forward-Port-Of: #144176

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: 769e1ce
@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Dec 5, 2023

Pull request status dashboard.

@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented Dec 5, 2023

@mwath @clesgow this PR targets master and is the last of the forward-port chain.

To merge the full chain, use

@fw-bot r+

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

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Dec 5, 2023
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Dec 5, 2023
@mwath
Copy link
Copy Markdown
Contributor

mwath commented Dec 6, 2023

@fw-bot r+

robodoo pushed a commit that referenced this pull request Dec 6, 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

closes #145063

X-original-commit: 769e1ce
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
@robodoo robodoo closed this Dec 6, 2023
@robodoo robodoo added the 17.1 label Dec 6, 2023
@fw-bot fw-bot deleted the master-16.0-mrp-fix-underconsumption-split-unreserve-wama-dcx0-fw branch December 20, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

17.1 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