From 7665eac277a1128eb686f97d3038fdd5d27c1063 Mon Sep 17 00:00:00 2001 From: rs-rethik Date: Wed, 11 Dec 2024 12:15:56 +0530 Subject: [PATCH] feat: change type link to multiselect (cherry picked from commit 4de180feeea20a2f0a2c9c4ba794f1db55f82ed8) --- .../process_statement_of_accounts.json | 6 ++-- .../process_statement_of_accounts.py | 7 ++-- .../__init__.py | 0 .../process_statement_of_accounts_cc.json | 32 +++++++++++++++++++ .../process_statement_of_accounts_cc.py | 23 +++++++++++++ 5 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 erpnext/accounts/doctype/process_statement_of_accounts_cc/__init__.py create mode 100644 erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.json create mode 100644 erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.py diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json index 763607c22a16..ed9a4d84f534 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json @@ -244,9 +244,9 @@ }, { "fieldname": "cc_to", - "fieldtype": "Link", + "fieldtype": "Table MultiSelect", "label": "CC To", - "options": "User" + "options": "Process Statement Of Accounts CC" }, { "default": "1", @@ -400,7 +400,7 @@ } ], "links": [], - "modified": "2024-10-18 17:51:39.108481", + "modified": "2024-12-11 12:11:13.543134", "modified_by": "Administrator", "module": "Accounts", "name": "Process Statement Of Accounts", diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py index bf1c8c0b66ef..6910559b8b47 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py @@ -31,6 +31,9 @@ class ProcessStatementOfAccounts(Document): if TYPE_CHECKING: from frappe.types import DF + from erpnext.accounts.doctype.process_statement_of_accounts_cc.process_statement_of_accounts_cc import ( + ProcessStatementOfAccountsCC, + ) from erpnext.accounts.doctype.process_statement_of_accounts_customer.process_statement_of_accounts_customer import ( ProcessStatementOfAccountsCustomer, ) @@ -41,7 +44,7 @@ class ProcessStatementOfAccounts(Document): ageing_based_on: DF.Literal["Due Date", "Posting Date"] based_on_payment_terms: DF.Check body: DF.TextEditor | None - cc_to: DF.Link | None + cc_to: DF.TableMultiSelect[ProcessStatementOfAccountsCC] collection_name: DF.DynamicLink | None company: DF.Link cost_center: DF.TableMultiSelect[PSOACostCenter] @@ -324,7 +327,7 @@ def get_recipients_and_cc(customer, doc): cc = [] if doc.cc_to != "": try: - cc = [frappe.get_value("User", doc.cc_to, "email")] + cc = [frappe.get_value("User", user.cc, "email") for user in doc.cc_to] except Exception: pass diff --git a/erpnext/accounts/doctype/process_statement_of_accounts_cc/__init__.py b/erpnext/accounts/doctype/process_statement_of_accounts_cc/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.json b/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.json new file mode 100644 index 000000000000..c6103048b507 --- /dev/null +++ b/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.json @@ -0,0 +1,32 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-12-11 12:10:04.654593", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "cc" + ], + "fields": [ + { + "fieldname": "cc", + "fieldtype": "Link", + "in_list_view": 1, + "label": "CC", + "options": "User" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2024-12-11 12:10:39.772598", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Process Statement Of Accounts CC", + "owner": "Administrator", + "permissions": [], + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.py b/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.py new file mode 100644 index 000000000000..a500b6c89a72 --- /dev/null +++ b/erpnext/accounts/doctype/process_statement_of_accounts_cc/process_statement_of_accounts_cc.py @@ -0,0 +1,23 @@ +# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class ProcessStatementOfAccountsCC(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 + + cc: DF.Link | None + parent: DF.Data + parentfield: DF.Data + parenttype: DF.Data + # end: auto-generated types + + pass