I need to hide all decimal values from the sub_total and total_amount of the sale_orders.
For that opened the currency settings from _ Accounting->Multicurrencies -> Currencies _ and then set Rounding Factor from 0.010000 to 0.000000 (got this clue from somewhere on the internet).
However, this produces a divide by zero error on Confirm Sale, when the total_amount is zero (due to 100% discounts)- specifically at
File "/opt/bahmni-erp/odoo/addons/account/models/account_move.py", line 63, in _compute_matched_percentage
move.matched_percentage = total_reconciled / total_amount
The code block at that location is
if float_is_zero(total_amount, precision_rounding=precision_currency.rounding):
move.matched_percentage = 1.0
else:
move.matched_percentage = total_reconciled / total_amount
That float_is_zero is calling some other set of functions and finally executes the else part and the division error.
When I set the rounding to 1.000000 - I think the issue is getting resolved and there's no such error now.
I couldn't find much documentation about the behavior of this field and how it's getting used under Odoo.
Could you please confirm whether the above solution is okay and won't make any more side effects?
Thanks.