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] sale_report_delivered_subtotal: Use price_reduce field when price_subtotal is zero #237

Conversation

carlosdauden
Copy link
Contributor

@OCA-git-bot
Copy link
Contributor

Hi @sergio-teruel,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 15.0 milestone Oct 20, 2023
@pedrobaeza
Copy link
Member

price_reduce mustn't be used, because it contains the unit price already rounded to the price digits, provoking rounding errors. Talking with Odoo sales dev in latest Odoo XP, they see that this field should be removed for avoiding confusions and I think it has been done in latest versions.

@carlosdauden carlosdauden force-pushed the 15.0-IMP-sale_report_delivered_subtotal-use_price_reduce branch from ebb7b68 to 5d35be4 Compare October 20, 2023 08:52
@carlosdauden carlosdauden changed the title [15.0][IMP] sale_report_delivered_subtotal: Use price_reduce field instead of price_subtotal calc [15.0][IMP] sale_report_delivered_subtotal: Use price_reduce field when price_subtotal is zero Oct 20, 2023
@carlosdauden carlosdauden force-pushed the 15.0-IMP-sale_report_delivered_subtotal-use_price_reduce branch from 5d35be4 to c7a4a22 Compare October 20, 2023 08:55
@carlosdauden
Copy link
Contributor Author

Changes made to use price_reduce only when price cannot be calculated from price_subtotal.

sum(
CASE WHEN l.price_subtotal <> 0
THEN (l.price_subtotal / l.product_uom_qty)
ELSE l.price_reduce
Copy link
Member

Choose a reason for hiding this comment

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

Why not doing here the operation of price_unit - discount for getting a price reduced without rounding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because for these rare cases I prefer the result to be more compatible with other modules than more accurate.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

OK, good enough

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

@pedrobaeza The merge process could not start, because command git fetch --quiet --force --prune https://github.com/OCA/sale-reporting 'refs/heads/*:refs/heads/*' failed with output:

fatal: unable to access 'https://github.com/OCA/sale-reporting/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

@pedrobaeza
Copy link
Member

Please fw-port it to v16.

@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 15.0-ocabot-merge-pr-237-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 86b7ae6 into OCA:15.0 Oct 22, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at b904ff0. 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.

4 participants