From 809d5caf8091c9cfca0550b61043be2fef3e3dbc Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 28 Jul 2022 07:11:16 +0530 Subject: [PATCH 1/3] fix: add asset repair to accounting dimension list (cherry picked from commit 452584c4bd512f1eb0e80acbab5fd1dc0982fc9c) --- erpnext/hooks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index cf1714a25e1..0556d40a4b8 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -589,6 +589,7 @@ accounting_dimension_doctypes = [ "Shipping Rule", "Landed Cost Item", "Asset Value Adjustment", + "Asset Repair", "Loyalty Program", "Fee Schedule", "Fee Structure", From a420d0242cdd4927718c269fd8e7aab702151e4f Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 4 Aug 2022 16:48:03 +0530 Subject: [PATCH 2/3] chore: patch for creating existing dimensions in asset repair (cherry picked from commit 80f508c4b12ddfead304674a7eea0f8a7cadbc19) # Conflicts: # erpnext/patches.txt --- erpnext/patches.txt | 22 ++++++++++++++ ..._accounting_dimensions_for_asset_repair.py | 29 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9077ed662ff..58d1bc00a0b 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -344,6 +344,28 @@ erpnext.patches.v13_0.agriculture_deprecation_warning erpnext.patches.v13_0.update_maintenance_schedule_field_in_visit erpnext.patches.v13_0.hospitality_deprecation_warning erpnext.patches.v13_0.delete_bank_reconciliation_detail +<<<<<<< HEAD +======= +erpnext.patches.v13_0.enable_provisional_accounting +erpnext.patches.v13_0.non_profit_deprecation_warning +erpnext.patches.v13_0.enable_ksa_vat_docs #1 +erpnext.patches.v13_0.show_india_localisation_deprecation_warning +erpnext.patches.v13_0.show_hr_payroll_deprecation_warning +erpnext.patches.v13_0.reset_corrupt_defaults +erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair + +[post_model_sync] +execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') +erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents +erpnext.patches.v14_0.delete_shopify_doctypes +erpnext.patches.v14_0.delete_healthcare_doctypes +erpnext.patches.v14_0.delete_hub_doctypes +erpnext.patches.v14_0.delete_hospitality_doctypes # 20-01-2022 +erpnext.patches.v14_0.delete_agriculture_doctypes # 15-06-2022 +erpnext.patches.v14_0.delete_education_doctypes +erpnext.patches.v14_0.delete_datev_doctypes +erpnext.patches.v14_0.rearrange_company_fields +>>>>>>> 80f508c4b1 (chore: patch for creating existing dimensions in asset repair) erpnext.patches.v13_0.update_sane_transfer_against erpnext.patches.v13_0.enable_provisional_accounting erpnext.patches.v13_0.update_disbursement_account diff --git a/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py b/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py new file mode 100644 index 00000000000..61a5c86386c --- /dev/null +++ b/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py @@ -0,0 +1,29 @@ +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_field + + +def execute(): + accounting_dimensions = frappe.db.get_all( + "Accounting Dimension", fields=["fieldname", "label", "document_type", "disabled"] + ) + + if not accounting_dimensions: + return + + for d in accounting_dimensions: + doctype = "Asset Repair" + field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": d.fieldname}) + + if field: + continue + + df = { + "fieldname": d.fieldname, + "label": d.label, + "fieldtype": "Link", + "options": d.document_type, + "insert_after": "accounting_dimensions_section", + } + + create_custom_field(doctype, df, ignore_validate=True) + frappe.clear_cache(doctype=doctype) From 9e16f4e4127954dd9d34578bf7f8f5b8d3ad4816 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 9 Aug 2022 17:55:02 +0530 Subject: [PATCH 3/3] chore: resolve conflicts --- erpnext/patches.txt | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 58d1bc00a0b..cbc224f99e4 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -344,28 +344,6 @@ erpnext.patches.v13_0.agriculture_deprecation_warning erpnext.patches.v13_0.update_maintenance_schedule_field_in_visit erpnext.patches.v13_0.hospitality_deprecation_warning erpnext.patches.v13_0.delete_bank_reconciliation_detail -<<<<<<< HEAD -======= -erpnext.patches.v13_0.enable_provisional_accounting -erpnext.patches.v13_0.non_profit_deprecation_warning -erpnext.patches.v13_0.enable_ksa_vat_docs #1 -erpnext.patches.v13_0.show_india_localisation_deprecation_warning -erpnext.patches.v13_0.show_hr_payroll_deprecation_warning -erpnext.patches.v13_0.reset_corrupt_defaults -erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair - -[post_model_sync] -execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') -erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents -erpnext.patches.v14_0.delete_shopify_doctypes -erpnext.patches.v14_0.delete_healthcare_doctypes -erpnext.patches.v14_0.delete_hub_doctypes -erpnext.patches.v14_0.delete_hospitality_doctypes # 20-01-2022 -erpnext.patches.v14_0.delete_agriculture_doctypes # 15-06-2022 -erpnext.patches.v14_0.delete_education_doctypes -erpnext.patches.v14_0.delete_datev_doctypes -erpnext.patches.v14_0.rearrange_company_fields ->>>>>>> 80f508c4b1 (chore: patch for creating existing dimensions in asset repair) erpnext.patches.v13_0.update_sane_transfer_against erpnext.patches.v13_0.enable_provisional_accounting erpnext.patches.v13_0.update_disbursement_account @@ -394,3 +372,4 @@ erpnext.patches.v13_0.show_india_localisation_deprecation_warning erpnext.patches.v13_0.fix_number_and_frequency_for_monthly_depreciation erpnext.patches.v13_0.reset_corrupt_defaults erpnext.patches.v13_0.show_hr_payroll_deprecation_warning +erpnext.patches.v13_0.create_accounting_dimensions_for_asset_repair