(elem, search_keys, prec=2)
This uses ``round`` method directly as if has been tested that Odoo's
    ``float_round`` still returns incorrect amounts for certain values. Try
    3 units x 3,77 €/unit with 10% tax and you will be hit by the error
    (on regular x86 architectures).
This uses ``round`` method directly as if has been tested that Odoo's
    ``float_round`` still returns incorrect amounts for certain values. Try
    3 units x 3,77 €/unit with 10% tax and you will be hit by the error
    (on regular x86 architectures).
This uses round method directly as if has been tested that Odoo s float_round still returns incorrect amounts for certain values . Try 3 units x 3 77 € / unit with 10% tax and you will be hit by the error ( on regular x86 architectures ) .
def round_by_keys(elem, search_keys, prec=2):
    """This uses ``round`` method directly as if has been tested that Odoo's
    ``float_round`` still returns incorrect amounts for certain values. Try
    3 units x 3,77 €/unit with 10% tax and you will be hit by the error
    (on regular x86 architectures)."""
    if isinstance(elem, dict):
        for key, value in elem.items():
            if key in search_keys:
                elem[key] = round(elem[key], prec)
            else:
                round_by_keys(value, search_keys)
    elif isinstance(elem, list):
        for value in elem:
            round_by_keys(value, search_keys)
def round_by_keys ( elem , search_keys , prec = 2 ) : if isinstance ( elem , dict ) : for key , value in elem . items ( ) : if key in search_keys : elem [ key ] = round ( elem [ key ] , prec ) else : round_by_keys ( value , search_keys ) elif isinstance ( elem , list ) : for value in elem : round_by_keys ( value , search_keys )