There is no reason for this to be happening that makes any sense. No fractions are used in our system. Also, how the h would it get a quantity of 25.000001 ???
This is happening when we try to save a production order using all whole quantities, all unit measurements.
Very frustrating
Hi @Solivety,
Have tried with keeping type as āfloatā for qty field through customise form.?
Ok so unchecking āmust be a whole numberā on the UOM for āunitā solved thisā¦but this doesnāt make sense and so I would like to continue this exploration a bit because:
āIsnāt the point of even having a āmust be a whole numberā checkbox specifically for things like āunitā (in this case coconuts) which will NEVER be less or more than a coconut?
What you observed versus what you expected can be explained!
Your case is a result of how ERPNext stores and manages numeric values: In the case of whole number (or integer) values and real number (of floating point) values, in either case quantity values are apparently all stored as a Python class float.
To confirm this, in the Setup module open a Customize DocType on Item and you will see numeric values Opening Stock Minimum Order Qty and so on are of Float type.
What you happened on is a case of representation error
14. Floating Point Arithmetic: Issues and Limitations ā Python 2.7.18 documentation
This function aims to identify such problems validate_uom_is_integer
Here are other references that may help
Ok, Iām just tentatively awakening my code mind so I will study this furtherā¦ So this is not really an error and yet it appearsā¦ So it seems then it is an error of omission(meaning just hasnāt been done yet) of the code that would truncate inappropriate float ?
I mean wouldnāt this be the equivalent of a simple If/then statementā¦ If quantity = (float) then truncate decimal ? (excuse the non-code code haha but you get the idea?)
Or am I missing somethingā¦
Just seems a simple fix, itās disconcerting for the non-coding user who is focused on his business bottomline to see a quantity of 25.000001 etcā¦ this is the type of thing that marginalizes ERPNext in my viewā¦
I look forward to being able to offer some of these solutions myself soon, but Iāve got a steep curve to deal with in the meantime just trying to get it usable