From c6466c7d97ad3c4ab87dfa65dbfba92c0c9116dc Mon Sep 17 00:00:00 2001 From: sahil28297 <37302950+sahil28297@users.noreply.github.com> Date: Thu, 7 May 2020 12:11:42 +0530 Subject: [PATCH 1/3] fix(item): patch to rename duplicate item_code values to name (#21621) --- erpnext/patches.txt | 1 + .../patches/v11_0/rename_duplicate_item_code_values.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/v11_0/rename_duplicate_item_code_values.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 3928c639ca4..843e11bfbac 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -496,6 +496,7 @@ erpnext.patches.v10_0.rename_offer_letter_to_job_offer execute:frappe.delete_doc('DocType', 'Production Planning Tool', ignore_missing=True) erpnext.patches.v10_0.migrate_daily_work_summary_settings_to_daily_work_summary_group # 24-12-2018 erpnext.patches.v10_0.add_default_cash_flow_mappers +erpnext.patches.v11_0.rename_duplicate_item_code_values erpnext.patches.v11_0.make_quality_inspection_template erpnext.patches.v10_0.update_status_for_multiple_source_in_po erpnext.patches.v10_0.set_auto_created_serial_no_in_stock_entry diff --git a/erpnext/patches/v11_0/rename_duplicate_item_code_values.py b/erpnext/patches/v11_0/rename_duplicate_item_code_values.py new file mode 100644 index 00000000000..00ab562c353 --- /dev/null +++ b/erpnext/patches/v11_0/rename_duplicate_item_code_values.py @@ -0,0 +1,8 @@ +import frappe + +def execute(): + items = [] + items = frappe.db.sql("""select item_code from `tabItem` group by item_code having count(*) > 1""", as_dict=True) + if items: + for item in items: + frappe.db.sql("""update `tabItem` set item_code=name where item_code = %s""", (item.item_code)) From a611cc59165ba9c739d2f4088a2c2cfcfd767867 Mon Sep 17 00:00:00 2001 From: sahil28297 <37302950+sahil28297@users.noreply.github.com> Date: Mon, 11 May 2020 19:28:30 +0530 Subject: [PATCH 2/3] fix(patch): use translated string while setting notification template (#21680) --- erpnext/patches/v11_0/set_default_email_template_in_hr.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v11_0/set_default_email_template_in_hr.py b/erpnext/patches/v11_0/set_default_email_template_in_hr.py index e895eaeb653..79d858a5623 100644 --- a/erpnext/patches/v11_0/set_default_email_template_in_hr.py +++ b/erpnext/patches/v11_0/set_default_email_template_in_hr.py @@ -1,9 +1,10 @@ from __future__ import unicode_literals +from frappe import _ import frappe def execute(): hr_settings = frappe.get_single("HR Settings") - hr_settings.leave_approval_notification_template = "Leave Approval Notification" - hr_settings.leave_status_notification_template = "Leave Status Notification" - hr_settings.save() \ No newline at end of file + hr_settings.leave_approval_notification_template = _("Leave Approval Notification") + hr_settings.leave_status_notification_template = _("Leave Status Notification") + hr_settings.save() From 78b7f69e0cb727ceb0a60eb864c268f963e63568 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Thu, 21 May 2020 15:15:08 +0550 Subject: [PATCH 3/3] bumped to version 11.1.76 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 87131c3fdc7..81791091858 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '11.1.75' +__version__ = '11.1.76' def get_default_company(user=None): '''Get default company for user'''