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.
(cherry picked from commit 33aad4b950)
This commit is contained in:
committed by
Ankush Menat
parent
819346f69f
commit
c1fbd2308c
@@ -1,6 +1,8 @@
|
||||
import unittest
|
||||
from functools import partial
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.controllers import queries
|
||||
|
||||
|
||||
@@ -85,3 +87,6 @@ class TestQueries(unittest.TestCase):
|
||||
|
||||
wh = query(filters=[["Bin", "item_code", "=", "_Test Item"]])
|
||||
self.assertGreaterEqual(len(wh), 1)
|
||||
|
||||
def test_default_uoms(self):
|
||||
self.assertGreaterEqual(frappe.db.count("UOM", {"enabled": 1}), 10)
|
||||
|
||||
@@ -350,7 +350,8 @@ def add_uom_data():
|
||||
"doctype": "UOM",
|
||||
"uom_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()
|
||||
|
||||
# bootstrap uom conversion factors
|
||||
|
||||
Reference in New Issue
Block a user