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

[15.0][IMP] stock_request: Change rounding method to HALF-UP in quantities computation #1989

Conversation

JoanSForgeFlow
Copy link
Contributor

@JoanSForgeFlow JoanSForgeFlow commented Apr 11, 2024

Switched the rounding method from "UP" (if not indicated default is "UP") to "HALF-UP" in the qty_in_progress computation to ensure more accurate roundings.

@AaronHForgeFlow
Copy link
Contributor

Maybe the same in request.qty_done and request.qty_cancelled ?

@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch from a403df6 to a16e260 Compare April 11, 2024 10:28
@JoanSForgeFlow
Copy link
Contributor Author

You are right @AaronHForgeFlow , I've just applied what you suggest

@JoanSForgeFlow JoanSForgeFlow changed the title [15.0][IMP] stock_request: Change rounding method to HALF-UP in qty_in_progress comptation [15.0][IMP] stock_request: Change rounding method to HALF-UP in quantities computation Apr 11, 2024
Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JordiMForgeFlow JordiMForgeFlow left a comment

Choose a reason for hiding this comment

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

code review LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

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

There are more usage in other files (examples:

rec.requested_product_qty = rec.product_uom_id._compute_quantity(
or
rec.product_qty = rec.product_uom_id._compute_quantity(
), any reason to change some usages and others not?

One more request, I think it would be great to depict the issue with a test case if possible.

@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch 4 times, most recently from 0ee24b4 to 3079e6c Compare May 8, 2024 12:12
@JoanSForgeFlow
Copy link
Contributor Author

@LoisRForgeFlow comments attended

@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch from 3079e6c to 9770a58 Compare May 8, 2024 13:28
@JoanSForgeFlow
Copy link
Contributor Author

The error in the test are caused by another module. I have done a fix: #2026

@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch from 9770a58 to 0ba93ed Compare May 8, 2024 14:30
@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch 3 times, most recently from cc060be to a1b4f67 Compare May 21, 2024 08:54
@JoanSForgeFlow JoanSForgeFlow force-pushed the 15.0-imp-stock_request-qty_in_progress-rounding_method branch from a1b4f67 to de2a85e Compare May 21, 2024 09:08
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

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

Let's move this one forward

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1989-by-LoisRForgeFlow-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 26318bd into OCA:15.0 May 21, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at eb34b0e. Thanks a lot for contributing to OCA. ❤️

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.

None yet

6 participants