Please have a look at:
https://github.com/frappe/erpnext/issues/9344
Any hint?
Hi JoEz,
"
I’m not sure why, it seems it’s getting wrong decimal symbol, actual settings are # ###,## with precision 3.
"
How do you get the context here for this float number format?
Is the error possibly with your expected behaviour?
Apparently a Conversion Factor value must be a whole number hence
0 represents a factor of 1
1 represents a factor of 10
2 represents a factor of 100
3 represents a factor of 1000
MariaDB [d56cb677eaab3383]> desc tabUOM Conversion Detail
;
±------------------±--------------±-----±----±---------±------+
| Field | Type | Null | Key | Default | Extra |
±------------------±--------------±-----±----±---------±------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | | NULL | |
| modified | datetime(6) | YES | | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | int(1) | NO | | 0 | |
| parent | varchar(140) | YES | MUL | NULL | |
| parentfield | varchar(140) | YES | | NULL | |
| parenttype | varchar(140) | YES | | NULL | |
| idx | int(8) | NO | | 0 | |
| conversion_factor | decimal(18,6) | NO | | 0.000000 | |
| uom | varchar(140) | YES | | NULL | |
±------------------±--------------±-----±----±---------±------+
MariaDB [d56cb677eaab3383]> select * from tabUOM Conversion Detail
where parent = ‘Table’;
±-----------±---------------------------±---------------------------±------------±------±----------±-------±------------±-----------±----±------------------±-----+
| name | creation | modified | modified_by | owner | docstatus | parent | parentfield | parenttype | idx | conversion_factor | uom |
±-----------±---------------------------±---------------------------±------------±------±----------±-------±------------±-----------±----±------------------±-----+
| d16838cc9f | 2017-04-13 18:37:39.623784 | 2017-04-13 18:37:39.623784 | NULL | NULL | 0 | Table | uoms | Item | 1 | 1.000000 | Nos |
±-----------±---------------------------±---------------------------±------------±------±----------±-------±------------±-----------±----±------------------±-----+
1 row in set (0.00 sec)
What you mean by this?
I don’t think it’s that kind of problem, more likely it’s misleading decimal symbol …if i enter 7 i get 7000.
I want to identify the code components to complete the puzzle here -
‘How do you get the context here for this float number format?’
IOW in your UOM case here where is this number format setting specified?
I see # ###,## is listed as a valid spec here, and the interpreter functions to calculate the numeric value
frappe-bench/apps/frappe/frappe/utils/data.py
My guess is UOM conversion factor specs are stored in a table but so far none that I can find for eg not in tabUOM Conversion Detail
(Recall for eg the case of autoname specs, those spec settings can found here:
select name, autoname from tabDocType where autoname like ‘%#%’;
The js conversion_factor code is here /sites/assets/js/erpnext.min.js