fix: UOM autocomplete broken

All new recent sites seem to have all UOMs as disabled by default. The
desired behaviour is exact opposite of this.
This commit is contained in:
Ankush Menat 2022-01-11 17:06:31 +05:30 committed by Ankush Menat
parent d6ee678ec9
commit 33aad4b950
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,8 @@
import unittest import unittest
from functools import partial from functools import partial
import frappe
from erpnext.controllers import queries from erpnext.controllers import queries
@ -85,3 +87,6 @@ class TestQueries(unittest.TestCase):
wh = query(filters=[["Bin", "item_code", "=", "_Test Item"]]) wh = query(filters=[["Bin", "item_code", "=", "_Test Item"]])
self.assertGreaterEqual(len(wh), 1) self.assertGreaterEqual(len(wh), 1)
def test_default_uoms(self):
self.assertGreaterEqual(frappe.db.count("UOM", {"enabled": 1}), 10)

View File

@ -353,7 +353,8 @@ def add_uom_data():
"doctype": "UOM", "doctype": "UOM",
"uom_name": _(d.get("uom_name")), "uom_name": _(d.get("uom_name")),
"name": _(d.get("uom_name")), "name": _(d.get("uom_name")),
"must_be_whole_number": d.get("must_be_whole_number") "must_be_whole_number": d.get("must_be_whole_number"),
"enabled": 1,
}).db_insert() }).db_insert()
# bootstrap uom conversion factors # bootstrap uom conversion factors