From 42e7725442c0c6d4ace34c84a9ca4ec8ae6d6e8f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:41:08 +0530 Subject: [PATCH] fix: add the company in payment request bcz delete company transactions (backport #42664) (#42982) * fix: add the company in payment request bcz delete company transactions (cherry picked from commit 12834ccf9aebb7c53e3eeafb4a5747b09da5eb77) # Conflicts: # erpnext/accounts/doctype/payment_request/payment_request.json * fix: link company when make payment request (cherry picked from commit e3008843d15ef0301c3171250bfcd81db738e5ae) * fix: add the company in payment request bcz delete company transactions --conflicts --------- Co-authored-by: Nihantra Patel Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com> --- .../doctype/payment_request/payment_request.json | 10 +++++++++- .../doctype/payment_request/payment_request.py | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json index 0537ee6d3a3..d0651f74bdf 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.json +++ b/erpnext/accounts/doctype/payment_request/payment_request.json @@ -9,6 +9,7 @@ "transaction_date", "column_break_2", "naming_series", + "company", "mode_of_payment", "party_details", "party_type", @@ -390,13 +391,20 @@ "options": "Payment Request", "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "read_only": 1 } ], "in_create": 1, "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-06-20 13:54:55.245774", + "modified": "2024-08-07 16:39:54.288002", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Request", diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index da63ccb6ad7..f368c2a9613 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -84,6 +84,7 @@ class PaymentRequest(Document): subscription_plans: DF.Table[SubscriptionPlanDetail] swift_number: DF.ReadOnly | None transaction_date: DF.Date | None + company: DF.Link | None # end: auto-generated types def validate(self): @@ -491,6 +492,7 @@ def make_payment_request(**args): "message": gateway_account.get("message") or get_dummy_message(ref_doc), "reference_doctype": args.dt, "reference_name": args.dn, + "company": ref_doc.get("company"), "party_type": args.get("party_type") or "Customer", "party": args.get("party") or ref_doc.get("customer"), "bank_account": bank_account,