From 0d09d21d2e12a5cc7cecf4c18389fa45051e79b9 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 3 Oct 2025 14:24:35 +0530 Subject: [PATCH] refactor: child table in process pcv --- .../process_period_closing_voucher.json | 11 ++++- .../process_period_closing_voucher.py | 5 +++ .../__init__.py | 0 ...process_period_closing_voucher_detail.json | 40 +++++++++++++++++++ .../process_period_closing_voucher_detail.py | 24 +++++++++++ 5 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 erpnext/accounts/doctype/process_period_closing_voucher_detail/__init__.py create mode 100644 erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.json create mode 100644 erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.py diff --git a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.json b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.json index 5368138a52b..cc85b6fb908 100644 --- a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.json +++ b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.json @@ -6,7 +6,8 @@ "engine": "InnoDB", "field_order": [ "parent_pcv", - "status" + "status", + "dates_to_process" ], "fields": [ { @@ -21,12 +22,18 @@ "fieldtype": "Select", "label": "Status", "options": "Queued\nRunning\nCompleted" + }, + { + "fieldname": "dates_to_process", + "fieldtype": "Table", + "label": "Dates to Process", + "options": "Process Period Closing Voucher Detail" } ], "grid_page_length": 50, "index_web_pages_for_search": 1, "links": [], - "modified": "2025-10-01 15:57:36.832943", + "modified": "2025-10-03 14:29:55.584225", "modified_by": "Administrator", "module": "Accounts", "name": "Process Period Closing Voucher", diff --git a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py index 784ae36ae2f..62410b52efb 100644 --- a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py +++ b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py @@ -14,6 +14,11 @@ class ProcessPeriodClosingVoucher(Document): if TYPE_CHECKING: from frappe.types import DF + from erpnext.accounts.doctype.process_period_closing_voucher_detail.process_period_closing_voucher_detail import ( + ProcessPeriodClosingVoucherDetail, + ) + + dates_to_process: DF.Table[ProcessPeriodClosingVoucherDetail] parent_pcv: DF.Link | None status: DF.Literal["Queued", "Running", "Completed"] # end: auto-generated types diff --git a/erpnext/accounts/doctype/process_period_closing_voucher_detail/__init__.py b/erpnext/accounts/doctype/process_period_closing_voucher_detail/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.json b/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.json new file mode 100644 index 00000000000..32aa85702e0 --- /dev/null +++ b/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.json @@ -0,0 +1,40 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2025-10-01 15:58:17.544153", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "processing_date", + "status" + ], + "fields": [ + { + "fieldname": "processing_date", + "fieldtype": "Date", + "label": "Processing Date" + }, + { + "default": "Queued", + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Queued\nRunning\nCompleted" + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2025-10-01 16:00:02.221411", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Process Period Closing Voucher Detail", + "owner": "Administrator", + "permissions": [], + "row_format": "Dynamic", + "rows_threshold_for_grid_search": 20, + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} diff --git a/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.py b/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.py new file mode 100644 index 00000000000..445451ee7c2 --- /dev/null +++ b/erpnext/accounts/doctype/process_period_closing_voucher_detail/process_period_closing_voucher_detail.py @@ -0,0 +1,24 @@ +# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class ProcessPeriodClosingVoucherDetail(Document): + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + parent: DF.Data + parentfield: DF.Data + parenttype: DF.Data + processing_date: DF.Date | None + status: DF.Literal["Queued", "Running", "Completed"] + # end: auto-generated types + + pass