mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 11:55:11 +00:00
fix: unpack non-iterable NoneType object error
(cherry picked from commit 7d940faa4f)
This commit is contained in:
committed by
Mergify
parent
33f1d7a5fe
commit
dd39d24da0
@@ -12,16 +12,7 @@ from erpnext.accounts.report.calculated_discount_mismatch.calculated_discount_mi
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
# run this patch only if erpnext version before update is v15.64.0 or higher
|
# run this patch only if erpnext version before update is v15.64.0 or higher
|
||||||
version, git_branch = frappe.db.get_value(
|
if not should_run_patch():
|
||||||
"Installed Application",
|
|
||||||
{"app_name": "erpnext"},
|
|
||||||
["app_version", "git_branch"],
|
|
||||||
)
|
|
||||||
|
|
||||||
semantic_version = get_semantic_version(version)
|
|
||||||
if semantic_version and (
|
|
||||||
semantic_version.major < 15 or (git_branch == "version-15" and semantic_version.minor < 64)
|
|
||||||
):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
for doctype in AFFECTED_DOCTYPES:
|
for doctype in AFFECTED_DOCTYPES:
|
||||||
@@ -85,3 +76,24 @@ def get_semantic_version(version):
|
|||||||
return Version(version)
|
return Version(version)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def should_run_patch():
|
||||||
|
installed_app = frappe.db.get_value(
|
||||||
|
"Installed Application",
|
||||||
|
{"app_name": "erpnext"},
|
||||||
|
["app_version", "git_branch"],
|
||||||
|
)
|
||||||
|
|
||||||
|
if not installed_app:
|
||||||
|
return True
|
||||||
|
|
||||||
|
version, git_branch = installed_app
|
||||||
|
semantic_version = get_semantic_version(version)
|
||||||
|
if not semantic_version:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return not (
|
||||||
|
semantic_version.major < 15
|
||||||
|
or (git_branch == "version-15" and semantic_version.major == 15 and semantic_version.minor < 64)
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user