Skip to content

Commit

Permalink
bugFix: address_title is shortened if name too long
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak-redsoftware committed Jan 11, 2024
1 parent ad20287 commit 9c70abc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ def create_address(self, address):
postal_code = addr_lines[3].split(':')[1].strip()
country = addr_lines[2].split(':')[1].strip()
country_exists = frappe.db.exists("Country", {"country_name": country})
address_title = address.strip().rsplit(',', 1)[0].strip() if len(address.strip().rsplit(',', 1)[0].strip()) < 100 else f"{city}, {country}"
print(address_title)
if country_exists:
doc = frappe.get_doc({
"doctype": "Address",
"address_title": address.strip(),
"address_title": address_title,
"address_type": "Office",
"address_line1": address.strip(),
"city": city if city != "NULL" else None,
Expand Down

0 comments on commit 9c70abc

Please sign in to comment.