I received a peppol invoice with a quantity of 0.009999999999999998, which errors out

Hi,

I just received an invoice from a supplier, on which a line has 0.009999999999999998 as quantity.

Import fails:

The number of digits in the value "'0.009999999999999998'" for field "Quantity" in record "acount - accountame @ [invoicenr]" of "Account Invoice Line" exceeds the limit of "(None, 2)".

The unit for that line has rounding precision 0,01 and displayed digits is 2, is this the problem ?

I know that that quantity is absurd, it should be 0,01 (and actually I think that they messed up their invoice generation), but it’s legal, and I cannot import it.

Is it just a case of adapting the unit, or is it a more important problem ?

Thanks,

Rémi

You shouldn’t interact with suppliers using Odoo

:grin:

With Search unit of measure compatible with the number of digits of the quantity in the UBL invoice (#14541) · Issues · Tryton / Tryton · GitLab, Tryton is smarter and searches for a unit with enough digits.

So if you do not have this fix, you need to create a unit with enough digits and set the UNECE code, but also remove the UNECE code from the “correct” unit.
Then once you have processed the invoice, you can deactivate the new unit and restore the UNECE code on the original unit.

For the future I would advise upgrading to 8.0.

odoo at Eneco ? Maybe… maybe not :slight_smile:

When comparing with last month invoice, they seem to have exchanged quantities and unit prices, and borked the rounding for quantities. I reported it, I’m probably not alone finding such a quantity completely absurd…