From ceccacac1f164311e5dc8a7e53df5af362426eb5 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Thu, 17 Mar 2022 13:42:37 +0530 Subject: [PATCH] fix: restore inadvertently deleted patches --- erpnext/patches.txt | 4 +++- .../v13_0/create_gst_payment_entry_fields.py | 20 +++++++++++++++++ ...oles_from_gst_report_non_indian_account.py | 22 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v13_0/create_gst_payment_entry_fields.py create mode 100644 erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b704d4233f..e657e3bd9e 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -10,6 +10,7 @@ erpnext.patches.v4_2.update_requested_and_ordered_qty #2021-03-31 erpnext.patches.v5_7.update_item_description_based_on_item_master erpnext.patches.v4_2.repost_reserved_qty #2021-03-31 execute:frappe.reload_doc("Payroll", "doctype", "salary_slip") +erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account #16-08-2018 erpnext.patches.v10_0.fichier_des_ecritures_comptables_for_france erpnext.patches.v10_0.rename_price_to_rate_in_pricing_rule erpnext.patches.v10_0.set_currency_in_pricing_rule @@ -271,6 +272,7 @@ execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings") execute:frappe.reload_doc("erpnext_integrations", "doctype", "Product Tax Category") erpnext.patches.v13_0.custom_fields_for_taxjar_integration #08-11-2021 erpnext.patches.v13_0.set_operation_time_based_on_operating_cost +erpnext.patches.v13_0.create_gst_payment_entry_fields #27-11-2021 erpnext.patches.v13_0.fix_invoice_statuses erpnext.patches.v13_0.create_website_items #30-09-2021 erpnext.patches.v13_0.populate_e_commerce_settings @@ -331,4 +333,4 @@ erpnext.patches.v13_0.set_work_order_qty_in_so_from_mr erpnext.patches.v13_0.update_accounts_in_loan_docs erpnext.patches.v14_0.update_batch_valuation_flag erpnext.patches.v14_0.delete_non_profit_doctypes -erpnext.patches.v14_0.update_employee_advance_status \ No newline at end of file +erpnext.patches.v14_0.update_employee_advance_status diff --git a/erpnext/patches/v13_0/create_gst_payment_entry_fields.py b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py new file mode 100644 index 0000000000..ee8fc5fa55 --- /dev/null +++ b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py @@ -0,0 +1,20 @@ +# Copyright (c) 2021, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +import frappe + + +# Patch kept for users outside India +def execute(): + if frappe.db.exists("Company", {"country": "India"}): + return + + for field in ( + "gst_section", + "company_address", + "company_gstin", + "place_of_supply", + "customer_address", + "customer_gstin", + ): + frappe.delete_doc_if_exists("Custom Field", f"Payment Entry-{field}") diff --git a/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py new file mode 100644 index 0000000000..5b1885d6ec --- /dev/null +++ b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py @@ -0,0 +1,22 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe + + +def execute(): + if frappe.db.exists("Company", {"country": "India"}): + return + + frappe.reload_doc("core", "doctype", "has_role") + frappe.db.sql( + """ + delete from + `tabHas Role` + where + parenttype = 'Report' and parent in('GST Sales Register', + 'GST Purchase Register', 'GST Itemised Sales Register', + 'GST Itemised Purchase Register', 'Eway Bill') + """ + )