Skip to content

Commit

Permalink
fix: customer code max characters limit issue (#32177)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8f787c0)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed Sep 12, 2022
1 parent 0bc61b3 commit 93e5100
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/stock/doctype/item/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
},
{
"fieldname": "customer_code",
"fieldtype": "Data",
"fieldtype": "Small Text",
"hidden": 1,
"label": "Customer Code",
"no_copy": 1,
Expand Down Expand Up @@ -910,7 +910,7 @@
"image_field": "image",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-06-15 09:02:06.177691",
"modified": "2022-09-12 15:00:10.130340",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
Expand Down
8 changes: 8 additions & 0 deletions erpnext/stock/doctype/item/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,14 @@ def test_item_type_field_change(self):
item.has_batch_no = 1
item.save()

def test_customer_codes_length(self):
"""Check if item code with special characters are allowed."""
item = make_item(properties={"item_code": "Test Item Code With Special Characters"})
for row in range(3):
item.append("customer_items", {"ref_code": frappe.generate_hash("", 120)})
item.save()
self.assertTrue(len(item.customer_code) > 140)


def set_item_variant_settings(fields):
doc = frappe.get_doc("Item Variant Settings")
Expand Down

0 comments on commit 93e5100

Please sign in to comment.