Closed bunhin closed 2 years ago
Sorry, but you should expect rounding problems when you are putting Price accuracy to 0, as a lot of roundings are doing in between. I think this is not a problem of the module itself, but all the code involved, and if you expect that someone fixes this because he/she has the same use case, I don't think so as this is the first time I find this weird case, but I invite you to investigate yourself the problem or pay someone to do it, and obviously if there's a problem, grateful if you contribute back with the solution here.
Dear @pedrobaeza, i am really sorry for my very shallow understanding on the whole code and coding itself, but i like to report that i think it is may help. Please forgive me if my report wordings or redaction is not polite to anybody here in the forum and causing negative feelings. I do not mean to ask anybody to fix it for my need at all. I like to contribute what i can, at current level of my skill maybe just report what look a bug for me.
In my humble opinion, we very understand if we cut the trailing value after the decimal point during the input and not getting exact correct result as if the trailing value is included and not rounded (because we set it no place for the decimal value). But if we have whole number 280 qty and 3050 unit value and whole number 5 for the discount, we expect correct computation result as simple calculator can do. Anyway what i learn just now, the 4 zeros or more after the decimal point is important although we never put any number there because always have whole number to input. And now i understand why my friend said he can not use Odoo for multi currency because the rounding error is too big for him (especially for base currency that is very low compared to USD). Thank you once again for inform it with your response.
No, your message is absolutely polite. That's not the problem. The problem comes from trying to force with a weird rounding to 0 all Odoo to work perfectly without rounding problems, and that's not possible always as in this case.
understand, thank you
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
I create this as new issue since previous one has been closed. Issue: The purchase_discount module give noticeable compute error, possible some lines correct and some lines error when there are many lines in purchase order with discount.
I found the problem is caused by rounding (when the decimal accuracy of price unit is set 0 or no decimal) This error is significant and unacceptable accounting-wise, especially when user set 0 on product price decimal accuracy due to certain condition
How to reproduce update code base Create new database Install purchase apps and purchase_discount module from OCA github set decimal accuracy : 0 for product price and 2 (or leave as default) for purchase discount create rfq or purchase order and add some order lines, try with 280 on qty, 3050 on unit price on all lines but use different discount value such as 5, 10, 2, 4, 3, 6, 7, 9 We will find out error in amount of some order lines (the ones with odd discount value in this case, 5, 7. 9) and the error is accumulated on total order as well.
Screen shot:
Please have a look and help in order to get the module work also when price unit decimal accuracy is set 0 and the value of price unit and the discount value combination bring effect on the rounding error.
with thanks and regards