[Enhancement] UOM Conversion Factors (#13853)
* new doctype UOM category
* new doctype UOM Conversion Factor
* bootstrap json data for uom conversions
* uom conversion in item
* Patch to add all conversions and categories
* Fetch conversions multi-way
* fix codacy
* Rebase with develop
* [minor] Fix
* Add a test case
* Improvise as per review comment
* Add json data for UOMs
* Commonify function and call from patch
* Update uom_conversion_data.py
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index d68603e..8e9de96 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -520,6 +520,7 @@
erpnext.patches.v11_0.update_department_lft_rgt
erpnext.patches.v11_0.add_default_email_template_for_leave
erpnext.patches.v11_0.set_default_email_template_in_hr
+erpnext.patches.v11_0.uom_conversion_data
erpnext.patches.v10_0.taxes_issue_with_pos
erpnext.patches.v11_0.update_account_type_in_party_type
erpnext.patches.v10_1.transfer_subscription_to_auto_repeat
diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py
new file mode 100644
index 0000000..41876d6
--- /dev/null
+++ b/erpnext/patches/v11_0/uom_conversion_data.py
@@ -0,0 +1,11 @@
+import frappe, json
+
+def execute():
+ from erpnext.setup.setup_wizard.operations.install_fixtures import add_uom_data
+
+ frappe.reload_doc("setup", "doctype", "UOM Conversion Factor")
+ frappe.reload_doc("setup", "doctype", "UOM")
+ frappe.reload_doc("stock", "doctype", "UOM Category")
+
+ if not frappe.db.a_row_exists("UOM Conversion Factor"):
+ add_uom_data()
diff --git a/erpnext/setup/doctype/uom_conversion_factor/__init__.py b/erpnext/setup/doctype/uom_conversion_factor/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/__init__.py
diff --git a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.js b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.js
new file mode 100644
index 0000000..afcf74c
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: UOM Conversion Factor", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new UOM Conversion Factor
+ () => frappe.tests.make('UOM Conversion Factor', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py
new file mode 100644
index 0000000..04596ef
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestUOMConversionFactor(unittest.TestCase):
+ pass
diff --git a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js
new file mode 100644
index 0000000..e734d83
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('UOM Conversion Factor', {
+ refresh: function() {
+
+ }
+});
diff --git a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.json b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.json
new file mode 100644
index 0000000..294cd07
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.json
@@ -0,0 +1,224 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "UOM.#####",
+ "beta": 0,
+ "creation": "2018-04-30 17:37:02.347217",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "category",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Category",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM Category",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_2",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "from_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "From",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "to_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "To",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "value",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Value",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-06-05 12:50:02.648100",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "UOM Conversion Factor",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py
new file mode 100644
index 0000000..3566c53
--- /dev/null
+++ b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class UOMConversionFactor(Document):
+ pass
diff --git a/erpnext/setup/setup_wizard/data/uom_conversion_data.json b/erpnext/setup/setup_wizard/data/uom_conversion_data.json
new file mode 100644
index 0000000..7e8ce10
--- /dev/null
+++ b/erpnext/setup/setup_wizard/data/uom_conversion_data.json
@@ -0,0 +1,1575 @@
+[
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Meter",
+ "abbr": "m",
+ "value": "1"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Barleycorn",
+ "value": "0.008467"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Calibre",
+ "abbr": "cal",
+ "value": "0.0254"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Cable Length (UK)",
+ "abbr": "cables",
+ "value": "182.88"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Cable Length (US)",
+ "abbr": "cables",
+ "value": "219.456"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Cable Length",
+ "abbr": "cables",
+ "value": "185.2"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Centimeter",
+ "abbr": "cm",
+ "value": "0.01"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Chain",
+ "abbr": "ch",
+ "value": "20.1168"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Decimeter",
+ "abbr": "dm",
+ "value": "0.1"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Ells (UK)",
+ "abbr": "ells",
+ "value": "0.875"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Ems(Pica)",
+ "abbr": "ems",
+ "value": "0.004233"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Fathom",
+ "abbr": "fm",
+ "value": "1.8288"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Foot",
+ "abbr": "ft",
+ "value": "0.3048"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Furlong",
+ "abbr": "fur",
+ "value": "201.168"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Hand",
+ "abbr": "hand",
+ "value": "0.1016"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Hectometer",
+ "abbr": "hm",
+ "value": "100"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Inch",
+ "abbr": "in",
+ "value": "0.0254"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Kilometer",
+ "abbr": "km",
+ "value": "1000"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Link",
+ "abbr": "li",
+ "value": "0.201168"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Micrometer",
+ "abbr": "µm",
+ "value": "0.000001"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Mile",
+ "abbr": "mi",
+ "value": "1609.344"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Mile (Nautical)",
+ "abbr": "nmi(NM)",
+ "value": "1852"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Millimeter",
+ "abbr": "mm",
+ "value": "0.001"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Nanometer",
+ "abbr": "nm",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Rod",
+ "abbr": "rd",
+ "value": "5.02921"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Vara",
+ "abbr": "V",
+ "value": "0.835906"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Versta",
+ "value": "1066.8"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Yard",
+ "abbr": "yd",
+ "value": "0.9144"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Arshin",
+ "value": "0.7112"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Sazhen",
+ "value": "2.1336"
+ },
+ {
+ "category": "Length",
+ "from_uom": "Meter",
+ "to_uom": "Medio Metro",
+ "abbr": "mediom",
+ "value": "0.5"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Meter",
+ "value": "1"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Centiarea",
+ "abbr": "CentArea",
+ "value": "1"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Area",
+ "abbr": "Area",
+ "value": "100"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Manzana",
+ "abbr": "Mz",
+ "value": "6987.388"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Caballeria",
+ "abbr": "Cbll",
+ "value": "447192.86"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Kilometer",
+ "value": "1000000"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Are",
+ "abbr": "a",
+ "value": "100"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Acre",
+ "abbr": "ac",
+ "value": "4046.856422"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Acre (US)",
+ "abbr": "ac",
+ "value": "4046.87261"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Hectare",
+ "abbr": "ha",
+ "value": "10000"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Yard",
+ "value": "0.83612736"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Foot",
+ "value": "0.09290304"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Inch",
+ "value": "0.00064516"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Centimeter",
+ "value": "0.0001"
+ },
+ {
+ "category": "Area",
+ "from_uom": "Square Meter",
+ "to_uom": "Square Mile",
+ "value": "2589988.11"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Meter/Second",
+ "abbr": "m/s",
+ "value": "1"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Inch/Minute",
+ "abbr": "ipm",
+ "value": "0.000423333"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Foot/Minute",
+ "abbr": "fpm",
+ "value": "0.00508"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Inch/Second",
+ "abbr": "ips",
+ "value": "0.0254"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Kilometer/Hour",
+ "abbr": "km/h",
+ "value": "0.277777778"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Foot/Second",
+ "abbr": "fps",
+ "value": "0.3048"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Mile/Hour",
+ "abbr": "mph",
+ "value": "0.44704"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Knot",
+ "abbr": "kn",
+ "value": "0.514444"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Mile/Minute",
+ "abbr": "mpm",
+ "value": "26.8224"
+ },
+ {
+ "category": "Speed",
+ "from_uom": "Meter/Second",
+ "to_uom": "Mile/Second",
+ "abbr": "mps",
+ "value": "1609.344"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Carat",
+ "abbr": "carat",
+ "value": "0.0002"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Cental",
+ "abbr": "cental",
+ "value": "45.359237"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Dram",
+ "abbr": "dr",
+ "value": "0.001771845"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Grain",
+ "abbr": "gr",
+ "value": "0.000065"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Gram",
+ "abbr": "g",
+ "value": "0.001"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Hundredweight",
+ "abbr": "cwt",
+ "value": "45.359237"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Quintal",
+ "abbr": "qq",
+ "value": "45.359237"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Kg",
+ "abbr": "kg",
+ "value": "1"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Microgram",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Milligram",
+ "abbr": "mg",
+ "value": "0.000001"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Ounce",
+ "abbr": "oz",
+ "value": "0.02835"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Pood",
+ "abbr": "pood",
+ "value": "16.3805"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Pound",
+ "abbr": "lbm",
+ "value": "0.45359237"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Slug",
+ "abbr": "slug",
+ "value": "14.5939029"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Stone",
+ "abbr": "stone",
+ "value": "6.350293"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Tonne",
+ "abbr": "t",
+ "value": "1000"
+ },
+ {
+ "category": "Mass",
+ "from_uom": "Kg",
+ "to_uom": "Kip",
+ "abbr": "kip",
+ "value": "453.59237"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Barrel(Beer)",
+ "abbr": "bbl",
+ "value": "117.3478"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Barrel (Oil)",
+ "abbr": "bbl",
+ "value": "158.987295"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Bushel (UK)",
+ "abbr": "bu",
+ "value": "36.36872"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Bushel (US Dry Level)",
+ "abbr": "bu",
+ "value": "35.23907017"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Centilitre",
+ "abbr": "cl",
+ "value": "0.01"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Centimeter",
+ "value": "0.001"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Decimeter",
+ "value": "1"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Foot",
+ "value": "28.31684659"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Inch",
+ "value": "0.016387064"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Meter",
+ "value": "1000"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Millimeter",
+ "value": "0.000001"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cubic Yard",
+ "value": "764.554858"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Cup",
+ "abbr": "cp",
+ "value": "0.236588"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Decilitre",
+ "abbr": "dl",
+ "value": "0.1"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Fluid Ounce (UK)",
+ "abbr": "fl oz",
+ "value": "0.028413"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Fluid Ounce (US)",
+ "abbr": "fl oz",
+ "value": "0.029574"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Gallon (UK)",
+ "abbr": "gal",
+ "value": "4.54609"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Gallon Dry (US)",
+ "abbr": "gal",
+ "value": "4.404884"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Gallon Liquid (US)",
+ "abbr": "gal",
+ "value": "3.785411784"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Litre",
+ "abbr": "L",
+ "value": "1"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Millilitre",
+ "abbr": "ml",
+ "value": "0.001"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Peck",
+ "abbr": "pk",
+ "value": "8.809768"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Pint (UK)",
+ "abbr": "pt",
+ "value": "0.568261"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Pint, Dry (US)",
+ "abbr": "pt",
+ "value": "0.55061"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Pint, Liquid (US)",
+ "abbr": "pt",
+ "value": "0.473176475"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Quart (UK)",
+ "abbr": "qt",
+ "value": "1.136523"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Quart Dry (US)",
+ "abbr": "qt",
+ "value": "1.136523"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Quart Liquid (US)",
+ "abbr": "qt",
+ "value": "1.136523"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Tablespoon (US)",
+ "abbr": "tbsp",
+ "value": "0.014787"
+ },
+ {
+ "category": "Volume",
+ "from_uom": "Litre",
+ "to_uom": "Teaspoon",
+ "abbr": "tsp",
+ "value": "0.004929"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Day",
+ "value": "86400"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Hour",
+ "abbr": "h",
+ "value": "3600"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Minute",
+ "abbr": "min",
+ "value": "60"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Second",
+ "abbr": "s",
+ "value": "1"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Millisecond",
+ "abbr": "ms",
+ "value": "0.001"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Microsecond",
+ "value": "0.000001"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Nanosecond",
+ "abbr": "ns",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Time",
+ "from_uom": "Second",
+ "to_uom": "Week",
+ "value": "604800"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Atmosphere",
+ "abbr": "atm",
+ "value": "101325"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Pascal",
+ "abbr": "Pa",
+ "value": "1"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Bar",
+ "abbr": "bar",
+ "value": "100000"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Foot Of Water",
+ "abbr": "ftH2O",
+ "value": "2989.06692"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Hectopascal",
+ "abbr": "hPa",
+ "value": "100"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Iches Of Water",
+ "abbr": "inH2O",
+ "value": "249.08891"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Inches Of Mercury",
+ "abbr": "inHg",
+ "value": "3386.388"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Kilopascal",
+ "abbr": "kPa",
+ "value": "1000"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Meter Of Water",
+ "abbr": "mH2O",
+ "value": "9806.65"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Microbar",
+ "value": "0.1"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Milibar",
+ "abbr": "mbar",
+ "value": "100"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Millimeter Of Mercury",
+ "abbr": "mmHg",
+ "value": "133.322"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Millimeter Of Water",
+ "abbr": "mmH2O",
+ "value": "9.80665"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Technical Atmosphere",
+ "abbr": "at",
+ "value": "98066.5"
+ },
+ {
+ "category": "Pressure",
+ "from_uom": "Pascal",
+ "to_uom": "Torr",
+ "abbr": "torr",
+ "value": "133.322"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Dyne",
+ "abbr": "dyn",
+ "value": "0.00001"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Gram-Force",
+ "abbr": "gf",
+ "value": "0.00980665"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Joule/Meter",
+ "abbr": "J/m",
+ "value": "1"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Kilogram-Force",
+ "abbr": "kgf",
+ "value": "9.80665"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Kilopond",
+ "abbr": "kp",
+ "value": "9.80665"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Kilopound-Force",
+ "abbr": "kipf",
+ "value": "4448.221615"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Newton",
+ "abbr": "N",
+ "value": "1"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Ounce-Force",
+ "abbr": "ozf",
+ "value": "0.278013851"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Pond",
+ "abbr": "p",
+ "value": "0.00980665"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Pound-Force",
+ "abbr": "lbf",
+ "value": "4.448222"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Poundal",
+ "abbr": "pdl",
+ "value": "0.138254954"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Tonne-Force(Metric)",
+ "abbr": "tf",
+ "value": "9806.65"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Ton-Force (UK)",
+ "abbr": "tf(UK)",
+ "value": "9964.016418"
+ },
+ {
+ "category": "Force",
+ "from_uom": "Newton",
+ "to_uom": "Ton-Force (US)",
+ "abbr": "tf(US)",
+ "value": "8896.443231"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Btu (It)",
+ "abbr": "dyn",
+ "value": "1055.056"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Btu (Th)",
+ "value": "1054.35"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Btu (Mean)",
+ "value": "1055.87"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Calorie (It)",
+ "abbr": "cal",
+ "value": "4.1868"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Calorie (Th)",
+ "value": "4.184"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Calorie (Mean)",
+ "value": "4.19002"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Calorie (Food)",
+ "value": "4186"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Erg",
+ "abbr": "erg",
+ "value": "0.0000001"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Horsepower-Hours",
+ "abbr": "hph",
+ "value": "2684520"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Inch Pound-Force",
+ "abbr": "in lbf",
+ "value": "0.112985"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Joule",
+ "abbr": "J",
+ "value": "1"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Kilojoule",
+ "abbr": "kJ",
+ "value": "1000"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Kilocalorie",
+ "abbr": "kcal",
+ "value": "4184"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Kilowatt-Hour",
+ "abbr": "kWh",
+ "value": "3600000"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Litre-Atmosphere",
+ "abbr": "litre-atm",
+ "value": "101.3253354"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Megajoule",
+ "abbr": "MJ",
+ "value": "1000000"
+ },
+ {
+ "category": "Energy",
+ "from_uom": "Joule",
+ "to_uom": "Watt-Hour",
+ "abbr": "Wh",
+ "value": "3600"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Btu/Hour",
+ "abbr": "B/h",
+ "value": "0.29301067"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Btu/Minutes",
+ "abbr": "B/min",
+ "value": "17.56863"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Btu/Seconds",
+ "abbr": "B/s",
+ "value": "1055.056"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Calorie/Seconds",
+ "abbr": "cal/s",
+ "value": "4.183076"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Horsepower",
+ "abbr": "hp",
+ "value": "745.6998716"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Kilowatt",
+ "abbr": "kW",
+ "value": "1000"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Megawatt",
+ "abbr": "MW",
+ "value": "1000000"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Volt-Ampere",
+ "abbr": "VA",
+ "value": "1"
+ },
+ {
+ "category": "Power",
+ "from_uom": "Watt",
+ "to_uom": "Watt",
+ "abbr": "W",
+ "value": "1"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Centigram/Litre",
+ "abbr": "cg/l",
+ "value": "0.01"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Decigram/Litre",
+ "abbr": "dg/l",
+ "value": "0.1"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Dekagram/Litre",
+ "abbr": "dag/l",
+ "value": "10"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Hectogram/Litre",
+ "abbr": "hg/l",
+ "value": "100"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Gram/Cubic Meter",
+ "value": "0.001"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Gram/Cubic Centimeter",
+ "value": "1000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Gram/Cubic Millimeter",
+ "value": "1000000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Gram/Litre",
+ "abbr": "g/l",
+ "value": "1"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Grain/Gallon (US)",
+ "value": "0.017118061"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Grain/Gallon (UK)",
+ "value": "0.014253768"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Grain/Cubic Foot",
+ "value": "0.002288352"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Kilogram/Cubic Meter",
+ "value": "1"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Kilogram/Cubic Centimeter",
+ "value": "1000000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Kilogram/Litre",
+ "abbr": "kg/l",
+ "value": "1000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Milligram/Cubic Meter",
+ "value": "0.000001"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Milligram/Cubic Centimeter",
+ "value": "1"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Milligram/Cubic Millimeter",
+ "value": "1000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Megagram/Litre",
+ "abbr": "Mg/l",
+ "value": "1000000"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Milligram/Litre",
+ "abbr": "mg/l",
+ "value": "0.001"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Microgram/Litre",
+ "abbr": "µm/l",
+ "value": "0.000001"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Nanogram/Litre",
+ "abbr": "ng/l",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ounce/Cubic Inch",
+ "value": "1729.994044"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ounce/Cubic Foot",
+ "value": "1.001153961"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ounce/Gallon (US)",
+ "abbr": "oz/gal(US)",
+ "value": "7.489151707"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ounce/Gallon (UK)",
+ "abbr": "oz/gal(UK)",
+ "value": "6.236023291"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Pound/Cubic Inch",
+ "value": "27679.90471"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Pound/Cubic Foot",
+ "value": "16.01846337"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Pound Cubic Yard",
+ "value": "0.593276421"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Pound/Gallon (US)",
+ "abbr": "lb/gal(US)",
+ "value": "119.8264273"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Pound/Gallon (UK)",
+ "abbr": "lb/gal(UK)",
+ "value": "99.77637266"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Psi/1000 Feet",
+ "abbr": "psi/1000 ft",
+ "value": "2.306658726"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Slug/Cubic Foot",
+ "value": "515.3788184"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ton (Short)/Cubic Yard",
+ "abbr": "ton(short)/yd³",
+ "value": "1186.552843"
+ },
+ {
+ "category": "Density",
+ "from_uom": "Gram/Litre",
+ "to_uom": "Ton (Long)/Cubic Yard",
+ "abbr": "ton(long)/yd³",
+ "value": "1328.939184"
+ },
+ {
+ "category": "Temperature",
+ "from_uom": "Celsius",
+ "to_uom": "Celsius",
+ "value": "1"
+ },
+ {
+ "category": "Temperature",
+ "from_uom": "Celsius",
+ "to_uom": "Fahrenheit",
+ "value": "0.555555556"
+ },
+ {
+ "category": "Temperature",
+ "from_uom": "Celsius",
+ "to_uom": "Kelvin",
+ "value": "1"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Cycle/Second",
+ "value": "1"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Nanohertz",
+ "abbr": "nHz",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Millihertz",
+ "abbr": "mHz",
+ "value": "0.001"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Hertz",
+ "abbr": "Hz",
+ "value": "1"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Kilohertz",
+ "abbr": "kHz",
+ "value": "1000"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Megahertz",
+ "abbr": "MHz",
+ "value": "1000000"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Wavelength In Gigametres",
+ "value": "0.299792458"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Wavelength In Megametres",
+ "value": "299.792458"
+ },
+ {
+ "category": "Frequency and Wavelength",
+ "from_uom": "Hertz",
+ "to_uom": "Wavelength In Kilometres",
+ "value": "299792.458"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Ampere-Hour",
+ "value": "3600"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Ampere-Minute",
+ "value": "60"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Ampere-Second",
+ "value": "1"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Coulomb",
+ "abbr": "C",
+ "value": "1"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "EMU Of Charge",
+ "value": "10"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Faraday",
+ "value": "96485.309"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Kilocoulomb",
+ "abbr": "kC",
+ "value": "1000"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Megacoulomb",
+ "abbr": "MC",
+ "value": "1000000"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Millicoulomb",
+ "abbr": "mC",
+ "value": "0.001"
+ },
+ {
+ "category": "Electrical Charge",
+ "from_uom": "Coulomb",
+ "to_uom": "Nanocoulomb",
+ "abbr": "nC",
+ "value": "0.000000001"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "Ampere",
+ "abbr": "A",
+ "value": "1"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "Abampere",
+ "abbr": "abA",
+ "value": "10"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "Biot",
+ "abbr": "Bi",
+ "value": "10"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "EMU of current",
+ "abbr": "EMU",
+ "value": "10"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "Kiloampere",
+ "abbr": "kA",
+ "value": "1000"
+ },
+ {
+ "category": "Electric Current",
+ "from_uom": "Ampere",
+ "to_uom": "Milliampere",
+ "abbr": "mA",
+ "value": "0.001"
+ },
+ {
+ "category": "Magnetic Induction",
+ "from_uom": "Gauss",
+ "to_uom": "Gamma",
+ "value": "0.00001"
+ },
+ {
+ "category": "Magnetic Induction",
+ "from_uom": "Gauss",
+ "to_uom": "Gauss",
+ "abbr": "G",
+ "value": "1"
+ },
+ {
+ "category": "Magnetic Induction",
+ "from_uom": "Gauss",
+ "to_uom": "Tesla",
+ "abbr": "T",
+ "value": "10000"
+ },
+ {
+ "category": "Agriculture",
+ "from_uom": "Percent",
+ "to_uom": "Percent",
+ "abbr": "%",
+ "value": "1"
+ },
+ {
+ "category": "Agriculture",
+ "from_uom": "Percent",
+ "to_uom": "Parts Per Million",
+ "abbr": "ppm",
+ "value": "0.0001"
+ }
+]
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/data/uom_data.json b/erpnext/setup/setup_wizard/data/uom_data.json
new file mode 100644
index 0000000..78cbf2c
--- /dev/null
+++ b/erpnext/setup/setup_wizard/data/uom_data.json
@@ -0,0 +1,952 @@
+[
+ {
+ "uom_name": "Unit",
+ "must_be_whole_number": 1
+ },
+ {
+ "uom_name": "Box",
+ "must_be_whole_number": 1
+ }, {
+ "uom_name": "Nos",
+ "must_be_whole_number": 1
+ }, {
+ "uom_name": "Pair",
+ "must_be_whole_number": 1
+ }, {
+ "uom_name": "Set",
+ "must_be_whole_number": 1
+ },
+ {
+ "uom_name": "Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Barleycorn",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calibre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cable Length (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cable Length (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cable Length",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Chain",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Decimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ells (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ems(Pica)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Fathom",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Furlong",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hand",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hectometer",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Inch",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilometer",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Link",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Micrometer",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Mile",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Mile (Nautical)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Nanometer",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Rod",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Vara",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Versta",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Arshin",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Sazhen",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Medio Metro",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Centiarea",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Area",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Manzana",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Caballeria",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Kilometer",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Are",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Acre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Acre (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hectare",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Inch",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Square Mile",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Meter/Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Inch/Minute",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Foot/Minute",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Inch/Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilometer/Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Foot/Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Mile/Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Knot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Mile/Minute",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Mile/Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Carat",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cental",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Dram",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Grain",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hundredweight",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Quintal",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kg",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Microgram",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milligram",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pood",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Slug",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Stone",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Tonne",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kip",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Barrel(Beer)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Barrel (Oil)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Bushel (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Bushel (US Dry Level)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Centilitre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Decimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Inch",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Millimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cubic Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cup",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Decilitre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Fluid Ounce (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Fluid Ounce (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gallon (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gallon Dry (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gallon Liquid (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millilitre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Peck",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pint (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pint, Dry (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pint, Liquid (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Quart (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Quart Dry (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Quart Liquid (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Tablespoon (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Teaspoon",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Day",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Minute",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millisecond",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Microsecond",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Nanosecond",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Week",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Atmosphere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pascal",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Bar",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Foot Of Water",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hectopascal",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Iches Of Water",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Inches Of Mercury",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilopascal",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Meter Of Water",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Microbar",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milibar",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millimeter Of Mercury",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millimeter Of Water",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Technical Atmosphere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Torr",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Dyne",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Joule/Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilogram-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilopond",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilopound-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Newton",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pond",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Poundal",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Tonne-Force(Metric)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ton-Force (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ton-Force (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu (It)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu (Th)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu (Mean)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calorie (It)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calorie (Th)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calorie (Mean)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calorie (Food)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Erg",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Horsepower-Hours",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Inch Pound-Force",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Joule",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilojoule",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilocalorie",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilowatt-Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Litre-Atmosphere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Megajoule",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Watt-Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu/Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu/Minutes",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Btu/Seconds",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Calorie/Seconds",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Horsepower",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilowatt",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Megawatt",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Volt-Ampere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Watt",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Centigram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Decigram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Dekagram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hectogram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram/Cubic Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram/Cubic Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram/Cubic Millimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Grain/Gallon (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Grain/Gallon (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Grain/Cubic Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilogram/Cubic Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilogram/Cubic Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilogram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milligram/Cubic Meter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milligram/Cubic Centimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milligram/Cubic Millimeter",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Megagram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milligram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Microgram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Nanogram/Litre",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce/Cubic Inch",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce/Cubic Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce/Gallon (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ounce/Gallon (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound/Cubic Inch",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound/Cubic Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound Cubic Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound/Gallon (US)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Pound/Gallon (UK)",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Psi/1000 Feet",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Slug/Cubic Foot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ton (Short)/Cubic Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ton (Long)/Cubic Yard",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Celsius",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Fahrenheit",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kelvin",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Cycle/Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Nanohertz",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millihertz",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Hertz",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilohertz",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Megahertz",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Wavelength In Gigametres",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Wavelength In Megametres",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Wavelength In Kilometres",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ampere-Hour",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ampere-Minute",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ampere-Second",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Coulomb",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "EMU Of Charge",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Faraday",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kilocoulomb",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Megacoulomb",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Millicoulomb",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Nanocoulomb",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Ampere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Abampere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Biot",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "EMU of current",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Kiloampere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Milliampere",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gamma",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Gauss",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Tesla",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Percent",
+ "must_be_whole_number": 0
+ },
+ {
+ "uom_name": "Parts Per Million",
+ "must_be_whole_number": 0
+ }
+
+]
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py
index afe982d..bf7d4c6 100644
--- a/erpnext/setup/setup_wizard/operations/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
-import frappe, os
+import frappe, os, json
from frappe import _
@@ -144,19 +144,6 @@
# Sales Person
{'doctype': 'Sales Person', 'sales_person_name': _('Sales Team'), 'is_group': 1, "parent_sales_person": ""},
- # UOM
- {'uom_name': _('Unit'), 'doctype': 'UOM', 'name': _('Unit'), "must_be_whole_number": 1},
- {'uom_name': _('Box'), 'doctype': 'UOM', 'name': _('Box'), "must_be_whole_number": 1},
- {'uom_name': _('Kg'), 'doctype': 'UOM', 'name': _('Kg')},
- {'uom_name': _('Meter'), 'doctype': 'UOM', 'name': _('Meter')},
- {'uom_name': _('Litre'), 'doctype': 'UOM', 'name': _('Litre')},
- {'uom_name': _('Gram'), 'doctype': 'UOM', 'name': _('Gram')},
- {'uom_name': _('Nos'), 'doctype': 'UOM', 'name': _('Nos'), "must_be_whole_number": 1},
- {'uom_name': _('Pair'), 'doctype': 'UOM', 'name': _('Pair'), "must_be_whole_number": 1},
- {'uom_name': _('Set'), 'doctype': 'UOM', 'name': _('Set'), "must_be_whole_number": 1},
- {'uom_name': _('Hour'), 'doctype': 'UOM', 'name': _('Hour')},
- {'uom_name': _('Minute'), 'doctype': 'UOM', 'name': _('Minute')},
-
# Mode of Payment
{'doctype': 'Mode of Payment',
'mode_of_payment': 'Check' if country=="United States" else _('Cheque'),
@@ -244,7 +231,6 @@
from erpnext.setup.setup_wizard.data.industry_type import get_industry_types
records += [{"doctype":"Industry Type", "industry": d} for d in get_industry_types()]
# records += [{"doctype":"Operation", "operation": d} for d in get_operations()]
-
records += [{'doctype': 'Lead Source', 'source_name': _(d)} for d in default_lead_sources]
base_path = frappe.get_app_path("erpnext", "hr", "doctype")
@@ -267,6 +253,30 @@
selling_settings.set_default_customer_group_and_territory()
selling_settings.save()
+ add_uom_data()
+
+def add_uom_data():
+ # add UOMs
+ uoms = json.loads(open(frappe.get_app_path("erpnext", "setup", "setup_wizard", "data", "uom_data.json")).read())
+ for d in uoms:
+ if not frappe.db.exists('UOM', d.get("uom_name")):
+ uom_doc = frappe.new_doc('UOM')
+ uom_doc.update(d)
+ uom_doc.save(ignore_permissions=True)
+
+ # bootstrap uom conversion factors
+ uom_conversions = json.loads(open(frappe.get_app_path("erpnext", "setup", "setup_wizard", "data", "uom_conversion_data.json")).read())
+ for d in uom_conversions:
+ if not frappe.db.exists("UOM Category", d.get("category")):
+ frappe.get_doc({
+ "doctype": "UOM Category",
+ "category_name": d.get("category")
+ }).insert(ignore_permissions=True)
+
+ uom_conversion = frappe.new_doc('UOM Conversion Factor')
+ uom_conversion.update(d)
+ uom_conversion.save(ignore_permissions=True)
+
def make_fixture_records(records):
from frappe.modules import scrub
for r in records:
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 59e2f58..0eb29a2 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -694,3 +694,23 @@
cur_frm.add_fetch('item_group', 'default_income_account', 'income_account');
},
});
+
+frappe.ui.form.on("UOM Conversion Detail", {
+ uom: function(frm, cdt, cdn) {
+ var row = locals[cdt][cdn];
+ if (row.uom) {
+ frappe.call({
+ method:"erpnext.stock.doctype.item.item.get_uom_conv_factor",
+ args: {
+ "uom": row.uom,
+ "stock_uom": frm.doc.stock_uom
+ },
+ callback: function(r) {
+ if (!r.exc && r.message) {
+ frappe.model.set_value(cdt, cdn, "conversion_factor", r.message);
+ }
+ }
+ });
+ }
+ }
+})
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 51f8b7e..90d77fe 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -119,6 +119,7 @@
self.make_thumbnail()
self.validate_fixed_asset()
self.validate_retain_sample()
+ self.validate_uom_conversion_factor()
if not self.get("__islocal"):
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
@@ -704,6 +705,13 @@
frappe.throw(_("Default Unit of Measure for Variant '{0}' must be same as in Template '{1}'")
.format(self.stock_uom, template_uom))
+ def validate_uom_conversion_factor(self):
+ if self.uoms:
+ for d in self.uoms:
+ value = get_uom_conv_factor(d.uom, self.stock_uom)
+ if value:
+ d.conversion_factor = value
+
def validate_attributes(self):
if (self.has_variants or self.variant_of) and self.variant_based_on == 'Item Attribute':
attributes = []
@@ -902,3 +910,26 @@
else:
return frappe.db.get_value("Item", item, ["name", "item_name", "description", "stock_uom",
"is_stock_item", "item_code", "item_group"], as_dict=1)
+
+@frappe.whitelist()
+def get_uom_conv_factor(uom, stock_uom):
+ uoms = [uom, stock_uom]
+ value = ""
+ uom_details = frappe.db.sql("""select to_uom, from_uom, value from `tabUOM Conversion Factor`\
+ where to_uom in ({0})
+ """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in uoms])), as_dict=True)
+
+ for d in uom_details:
+ if d.from_uom == stock_uom and d.to_uom == uom:
+ value = d.value
+ elif d.from_uom == uom and d.to_uom == stock_uom:
+ value = 1/flt(d.value)
+ else:
+ uom_stock = frappe.db.get_value("UOM Conversion Factor", {"to_uom": stock_uom}, ["from_uom", "value"], as_dict=1)
+ uom_row = frappe.db.get_value("UOM Conversion Factor", {"to_uom": uom}, ["from_uom", "value"], as_dict=1)
+
+ if uom_stock and uom_row:
+ if uom_stock.from_uom == uom_row.from_uom:
+ value = flt(uom_stock.value) * 1/flt(uom_row.value)
+
+ return value
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index 6d6d282..1e926e3 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -9,7 +9,7 @@
from erpnext.controllers.item_variant import (create_variant, ItemVariantExistsError,
InvalidItemAttributeValueError, get_variant)
from erpnext.stock.doctype.item.item import StockExistsForTemplate
-
+from erpnext.stock.doctype.item.item import get_uom_conv_factor
from frappe.model.rename_doc import rename_doc
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.stock.get_item_details import get_item_details
@@ -34,7 +34,6 @@
if properties:
item.update(properties)
-
if item.is_stock_item:
for item_default in [doc for doc in item.get("item_defaults") if not doc.default_warehouse]:
item_default.default_warehouse = "_Test Warehouse - _TC"
@@ -241,6 +240,24 @@
self.assertTrue(frappe.db.get_value("Bin",
{"item_code": "Test Item for Merging 2", "warehouse": "_Test Warehouse 1 - _TC"}))
+ def test_uom_conversion_factor(self):
+ if frappe.db.exists('Item', 'Test Item UOM'):
+ frappe.delete_doc('Item', 'Test Item UOM')
+
+ item_doc = make_item("Test Item UOM", {
+ "stock_uom": "Gram",
+ "uoms": [dict(uom='Carat'), dict(uom='Kg')]
+ })
+
+ for d in item_doc.uoms:
+ value = get_uom_conv_factor(d.uom, item_doc.stock_uom)
+ d.conversion_factor = value
+
+ self.assertEqual(item_doc.uoms[0].uom, "Carat")
+ self.assertEqual(item_doc.uoms[0].conversion_factor, 5)
+ self.assertEqual(item_doc.uoms[1].uom, "Kg")
+ self.assertEqual(item_doc.uoms[1].conversion_factor, 0.001)
+
def test_item_variant_by_manufacturer(self):
fields = [{'field_name': 'description'}, {'field_name': 'variant_based_on'}]
set_item_variant_settings(fields)
@@ -315,3 +332,4 @@
"company": "_Test Company"
})
item.save()
+
diff --git a/erpnext/stock/doctype/uom_category/__init__.py b/erpnext/stock/doctype/uom_category/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/__init__.py
diff --git a/erpnext/stock/doctype/uom_category/test_uom_category.js b/erpnext/stock/doctype/uom_category/test_uom_category.js
new file mode 100644
index 0000000..4b5972e
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/test_uom_category.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: UOM Category", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new UOM Category
+ () => frappe.tests.make('UOM Category', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/stock/doctype/uom_category/test_uom_category.py b/erpnext/stock/doctype/uom_category/test_uom_category.py
new file mode 100644
index 0000000..33bd408
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/test_uom_category.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestUOMCategory(unittest.TestCase):
+ pass
diff --git a/erpnext/stock/doctype/uom_category/uom_category.js b/erpnext/stock/doctype/uom_category/uom_category.js
new file mode 100644
index 0000000..48026da
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/uom_category.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('UOM Category', {
+ refresh: function() {
+
+ }
+});
diff --git a/erpnext/stock/doctype/uom_category/uom_category.json b/erpnext/stock/doctype/uom_category/uom_category.json
new file mode 100644
index 0000000..c5c38a0
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/uom_category.json
@@ -0,0 +1,93 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "autoname": "field:category_name",
+ "beta": 0,
+ "creation": "2018-04-30 17:27:14.742005",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "category_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Category Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-04-30 17:33:25.638223",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "UOM Category",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/uom_category/uom_category.py b/erpnext/stock/doctype/uom_category/uom_category.py
new file mode 100644
index 0000000..d5c339e
--- /dev/null
+++ b/erpnext/stock/doctype/uom_category/uom_category.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class UOMCategory(Document):
+ pass