mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
refactor: more data structure changes
(cherry picked from commit a15578f8f4)
This commit is contained in:
@@ -131,8 +131,11 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
frappe.throw(_("Currency of the Closing Account must be {0}").format(company_currency))
|
frappe.throw(_("Currency of the Closing Account must be {0}").format(company_currency))
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.db_set("gle_processing_status", "In Progress")
|
if frappe.get_single_value("Accounts Settings", "use_legacy_controller_for_pcv"):
|
||||||
self.make_gl_entries()
|
self.db_set("gle_processing_status", "In Progress")
|
||||||
|
self.make_gl_entries()
|
||||||
|
else:
|
||||||
|
print("submit")
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.ignore_linked_doctypes = (
|
self.ignore_linked_doctypes = (
|
||||||
@@ -141,9 +144,12 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
"Payment Ledger Entry",
|
"Payment Ledger Entry",
|
||||||
"Account Closing Balance",
|
"Account Closing Balance",
|
||||||
)
|
)
|
||||||
self.block_if_future_closing_voucher_exists()
|
if frappe.get_single_value("Accounts Settings", "use_legacy_controller_for_pcv"):
|
||||||
self.db_set("gle_processing_status", "In Progress")
|
self.block_if_future_closing_voucher_exists()
|
||||||
self.cancel_gl_entries()
|
self.db_set("gle_processing_status", "In Progress")
|
||||||
|
self.cancel_gl_entries()
|
||||||
|
else:
|
||||||
|
print("cancel")
|
||||||
|
|
||||||
def make_gl_entries(self):
|
def make_gl_entries(self):
|
||||||
if frappe.db.estimate_count("GL Entry") > 100_000:
|
if frappe.db.estimate_count("GL Entry") > 100_000:
|
||||||
|
|||||||
@@ -5,18 +5,28 @@
|
|||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"section_break_zqqu"
|
"parent_pcv",
|
||||||
|
"status"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "section_break_zqqu",
|
"fieldname": "parent_pcv",
|
||||||
"fieldtype": "Section Break"
|
"fieldtype": "Link",
|
||||||
|
"label": "PCV",
|
||||||
|
"options": "Period Closing Voucher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "Queued",
|
||||||
|
"fieldname": "status",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Status",
|
||||||
|
"options": "Queued\nRunning\nCompleted"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-09-25 15:44:03.534699",
|
"modified": "2025-10-01 15:57:36.832943",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Process Period Closing Voucher",
|
"name": "Process Period Closing Voucher",
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ class ProcessPeriodClosingVoucher(Document):
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from frappe.types import DF
|
from frappe.types import DF
|
||||||
|
|
||||||
|
parent_pcv: DF.Link | None
|
||||||
|
status: DF.Literal["Queued", "Running", "Completed"]
|
||||||
# end: auto-generated types
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user