From 5002f1f1e5e4823730d84c30c991c8ecc1de76ac Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Fri, 17 Jun 2022 15:43:59 +0530 Subject: [PATCH] feat: Add hidden field "is_old_subcontracting_flow" in PO, PR and PI --- .../purchase_invoice/purchase_invoice.json | 15 ++++++++++++--- .../doctype/purchase_order/purchase_order.json | 13 +++++++++++-- erpnext/patches.txt | 1 + ...tracted_value_to_is_old_subcontracting_flow.py | 12 ++++++++++++ .../purchase_receipt/purchase_receipt.json | 13 +++++++++++-- 5 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 erpnext/patches/v14_0/copy_is_subcontracted_value_to_is_old_subcontracting_flow.py diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 181dcc34de4..1c5c0609f1c 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -169,7 +169,8 @@ "column_break_114", "auto_repeat", "update_auto_repeat_reference", - "per_received" + "per_received", + "is_old_subcontracting_flow" ], "fields": [ { @@ -1416,13 +1417,21 @@ "label": "Advance Tax", "options": "Advance Tax", "read_only": 1 - } + }, + { + "default": "0", + "fieldname": "is_old_subcontracting_flow", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Old Subcontracting Flow", + "read_only": 1 + } ], "icon": "fa fa-file-text", "idx": 204, "is_submittable": 1, "links": [], - "modified": "2021-11-25 13:31:02.716727", + "modified": "2022-06-15 15:40:58.527065", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 07320d0a0ad..b622b4f1be8 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -141,7 +141,8 @@ "party_account_currency", "is_internal_supplier", "represents_company", - "inter_company_order_reference" + "inter_company_order_reference", + "is_old_subcontracting_flow" ], "fields": [ { @@ -1161,13 +1162,21 @@ "fieldtype": "Link", "label": "Project", "options": "Project" + }, + { + "default": "0", + "fieldname": "is_old_subcontracting_flow", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Old Subcontracting Flow", + "read_only": 1 } ], "icon": "fa fa-file-text", "idx": 105, "is_submittable": 1, "links": [], - "modified": "2022-04-26 18:46:58.863174", + "modified": "2022-06-15 15:40:58.527065", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 5a984635fdc..51038a5b39d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -374,3 +374,4 @@ erpnext.patches.v13_0.set_per_billed_in_return_delivery_note execute:frappe.delete_doc("DocType", "Naming Series") erpnext.patches.v13_0.set_payroll_entry_status erpnext.patches.v13_0.job_card_status_on_hold +erpnext.patches.v14_0.copy_is_subcontracted_value_to_is_old_subcontracting_flow diff --git a/erpnext/patches/v14_0/copy_is_subcontracted_value_to_is_old_subcontracting_flow.py b/erpnext/patches/v14_0/copy_is_subcontracted_value_to_is_old_subcontracting_flow.py new file mode 100644 index 00000000000..607ef69538e --- /dev/null +++ b/erpnext/patches/v14_0/copy_is_subcontracted_value_to_is_old_subcontracting_flow.py @@ -0,0 +1,12 @@ +# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +import frappe + + +def execute(): + for doctype in ["Purchase Order", "Purchase Receipt", "Purchase Invoice"]: + tab = frappe.qb.DocType(doctype).as_("tab") + frappe.qb.update(tab).set(tab.is_old_subcontracting_flow, 1).where( + tab.is_subcontracted == 1 + ).run() diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 923ceb36cd7..b3d38858d09 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -133,7 +133,8 @@ "transporter_name", "column_break5", "lr_no", - "lr_date" + "lr_date", + "is_old_subcontracting_flow" ], "fields": [ { @@ -1142,13 +1143,21 @@ { "fieldname": "dimension_col_break", "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "is_old_subcontracting_flow", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Old Subcontracting Flow", + "read_only": 1 } ], "icon": "fa fa-truck", "idx": 261, "is_submittable": 1, "links": [], - "modified": "2022-05-27 15:59:18.550583", + "modified": "2022-06-15 15:43:40.664382", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt",