mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
fix: patches were breaking while migrating (#27206)
* fix: patches were breaking while migrating (#27195)
* fix: patches were breaking while migrating
* fix: Removed duplicate function
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 17e0fa7a8b)
# Conflicts:
# erpnext/patches.txt
* fix: resolve conflicts
Co-authored-by: Shadrak Gurupnor <30501401+shadrak98@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
@@ -217,6 +217,7 @@ execute:frappe.delete_doc_if_exists("DocType", "Bank Reconciliation")
|
|||||||
erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll #22-06-2020
|
erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll #22-06-2020
|
||||||
erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020
|
erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020
|
||||||
execute:frappe.reload_doc("regional", "doctype", "e_invoice_settings")
|
execute:frappe.reload_doc("regional", "doctype", "e_invoice_settings")
|
||||||
|
erpnext.patches.v12_0.create_itc_reversal_custom_fields
|
||||||
erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020
|
erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020
|
||||||
erpnext.patches.v13_0.loyalty_points_entry_for_pos_invoice #22-07-2020
|
erpnext.patches.v13_0.loyalty_points_entry_for_pos_invoice #22-07-2020
|
||||||
erpnext.patches.v12_0.add_taxjar_integration_field
|
erpnext.patches.v12_0.add_taxjar_integration_field
|
||||||
@@ -274,7 +275,6 @@ erpnext.patches.v13_0.rename_discharge_date_in_ip_record
|
|||||||
erpnext.patches.v12_0.create_taxable_value_field
|
erpnext.patches.v12_0.create_taxable_value_field
|
||||||
erpnext.patches.v12_0.add_gst_category_in_delivery_note
|
erpnext.patches.v12_0.add_gst_category_in_delivery_note
|
||||||
erpnext.patches.v12_0.purchase_receipt_status
|
erpnext.patches.v12_0.purchase_receipt_status
|
||||||
erpnext.patches.v12_0.create_itc_reversal_custom_fields
|
|
||||||
erpnext.patches.v13_0.fix_non_unique_represents_company
|
erpnext.patches.v13_0.fix_non_unique_represents_company
|
||||||
erpnext.patches.v12_0.add_document_type_field_for_italy_einvoicing
|
erpnext.patches.v12_0.add_document_type_field_for_italy_einvoicing
|
||||||
erpnext.patches.v13_0.make_non_standard_user_type #13-04-2021
|
erpnext.patches.v13_0.make_non_standard_user_type #13-04-2021
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ def execute():
|
|||||||
]
|
]
|
||||||
|
|
||||||
for doctype in doctypes:
|
for doctype in doctypes:
|
||||||
frappe.reload_doc('Payroll', 'doctype', doctype)
|
frappe.reload_doc('Payroll', 'doctype', doctype, force=True)
|
||||||
|
|
||||||
|
|
||||||
reports = ['Professional Tax Deductions', 'Provident Fund Deductions']
|
reports = ['Professional Tax Deductions', 'Provident Fund Deductions', 'E-Invoice Summary']
|
||||||
for report in reports:
|
for report in reports:
|
||||||
frappe.reload_doc('Regional', 'Report', report)
|
frappe.reload_doc('Regional', 'Report', report)
|
||||||
frappe.reload_doc('Regional', 'Report', report)
|
frappe.reload_doc('Regional', 'Report', report)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ def execute():
|
|||||||
for report in reports_to_delete:
|
for report in reports_to_delete:
|
||||||
if frappe.db.exists("Report", report):
|
if frappe.db.exists("Report", report):
|
||||||
delete_auto_email_reports(report)
|
delete_auto_email_reports(report)
|
||||||
|
check_linked_reports(report)
|
||||||
|
|
||||||
frappe.delete_doc("Report", report)
|
frappe.delete_doc("Report", report)
|
||||||
|
|
||||||
@@ -21,3 +22,13 @@ def delete_auto_email_reports(report):
|
|||||||
auto_email_reports = frappe.db.get_values("Auto Email Report", {"report": report}, ["name"])
|
auto_email_reports = frappe.db.get_values("Auto Email Report", {"report": report}, ["name"])
|
||||||
for auto_email_report in auto_email_reports:
|
for auto_email_report in auto_email_reports:
|
||||||
frappe.delete_doc("Auto Email Report", auto_email_report[0])
|
frappe.delete_doc("Auto Email Report", auto_email_report[0])
|
||||||
|
|
||||||
|
def check_linked_reports(report):
|
||||||
|
""" Check if reports are referenced in Desktop Icon """
|
||||||
|
icons = frappe.get_all("Desktop Icon",
|
||||||
|
fields = ['name'],
|
||||||
|
filters = {
|
||||||
|
"_report": report
|
||||||
|
})
|
||||||
|
if icons:
|
||||||
|
frappe.delete_doc("Desktop Icon", icons)
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from erpnext.patches.v13_0.delete_old_purchase_reports import check_linked_reports
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
reports_to_delete = ["Ordered Items To Be Delivered", "Ordered Items To Be Billed"]
|
reports_to_delete = ["Ordered Items To Be Delivered", "Ordered Items To Be Billed"]
|
||||||
@@ -11,6 +12,7 @@ def execute():
|
|||||||
for report in reports_to_delete:
|
for report in reports_to_delete:
|
||||||
if frappe.db.exists("Report", report):
|
if frappe.db.exists("Report", report):
|
||||||
delete_auto_email_reports(report)
|
delete_auto_email_reports(report)
|
||||||
|
check_linked_reports(report)
|
||||||
|
|
||||||
frappe.delete_doc("Report", report)
|
frappe.delete_doc("Report", report)
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ def execute():
|
|||||||
rename_field('Opportunity', 'mins_to_first_response', 'first_response_time')
|
rename_field('Opportunity', 'mins_to_first_response', 'first_response_time')
|
||||||
|
|
||||||
# change fieldtype to duration
|
# change fieldtype to duration
|
||||||
|
frappe.reload_doc('crm', 'doctype', 'opportunity', force=True)
|
||||||
count = 0
|
count = 0
|
||||||
for entry in opportunities:
|
for entry in opportunities:
|
||||||
mins_to_first_response = convert_to_seconds(entry.mins_to_first_response, 'Minutes')
|
mins_to_first_response = convert_to_seconds(entry.mins_to_first_response, 'Minutes')
|
||||||
@@ -58,6 +59,8 @@ def execute():
|
|||||||
|
|
||||||
def convert_to_seconds(value, unit):
|
def convert_to_seconds(value, unit):
|
||||||
seconds = 0
|
seconds = 0
|
||||||
|
if value == 0:
|
||||||
|
return seconds
|
||||||
if unit == 'Hours':
|
if unit == 'Hours':
|
||||||
seconds = value * 3600
|
seconds = value * 3600
|
||||||
if unit == 'Minutes':
|
if unit == 'Minutes':
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ def execute():
|
|||||||
frappe.reload_doc('stock', 'doctype', 'purchase_receipt_item')
|
frappe.reload_doc('stock', 'doctype', 'purchase_receipt_item')
|
||||||
frappe.reload_doc('stock', 'doctype', 'delivery_note')
|
frappe.reload_doc('stock', 'doctype', 'delivery_note')
|
||||||
frappe.reload_doc('stock', 'doctype', 'delivery_note_item')
|
frappe.reload_doc('stock', 'doctype', 'delivery_note_item')
|
||||||
|
frappe.reload_doc('stock', 'doctype', 'stock_settings')
|
||||||
|
|
||||||
def update_from_return_docs(doctype):
|
def update_from_return_docs(doctype):
|
||||||
for return_doc in frappe.get_all(doctype, filters={'is_return' : 1, 'docstatus' : 1}):
|
for return_doc in frappe.get_all(doctype, filters={'is_return' : 1, 'docstatus' : 1}):
|
||||||
|
|||||||
Reference in New Issue
Block a user