Merge pull request #38282 from frappe/mergify/bp/version-15-hotfix/pr-38258

refactor: rename 'Unreconcile Payments' doctype to singular 'Unreconcile Payment' (backport #38258)
This commit is contained in:
ruthra kumar 2023-11-23 11:09:33 +05:30 committed by GitHub
commit fb4235c528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 29 additions and 29 deletions

View File

@ -51,7 +51,7 @@ frappe.ui.form.on("Journal Entry", {
}, __('Make')); }, __('Make'));
} }
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm); erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
}, },
before_save: function(frm) { before_save: function(frm) {
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) { if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {

View File

@ -9,7 +9,7 @@ erpnext.accounts.taxes.setup_tax_filters("Advance Taxes and Charges");
frappe.ui.form.on('Payment Entry', { frappe.ui.form.on('Payment Entry', {
onload: function(frm) { onload: function(frm) {
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payments', 'Unreconcile Payment Entries']; frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payment', 'Unreconcile Payment Entries'];
if(frm.doc.__islocal) { if(frm.doc.__islocal) {
if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null); if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null);
@ -160,7 +160,7 @@ frappe.ui.form.on('Payment Entry', {
}, __('Actions')); }, __('Actions'));
} }
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm); erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
}, },
validate_company: (frm) => { validate_company: (frm) => {

View File

@ -148,7 +148,7 @@ class PaymentEntry(AccountsController):
"Repost Payment Ledger Items", "Repost Payment Ledger Items",
"Repost Accounting Ledger", "Repost Accounting Ledger",
"Repost Accounting Ledger Items", "Repost Accounting Ledger Items",
"Unreconcile Payments", "Unreconcile Payment",
"Unreconcile Payment Entries", "Unreconcile Payment Entries",
) )
super(PaymentEntry, self).on_cancel() super(PaymentEntry, self).on_cancel()

View File

@ -180,7 +180,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
} }
this.frm.set_df_property("tax_withholding_category", "hidden", doc.apply_tds ? 0 : 1); this.frm.set_df_property("tax_withholding_category", "hidden", doc.apply_tds ? 0 : 1);
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm); erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm);
} }
unblock_invoice() { unblock_invoice() {

View File

@ -37,7 +37,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
super.onload(); super.onload();
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log', this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log',
'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payments", "Unreconcile Payment Entries"]; 'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) { if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
// show debit_to in print format // show debit_to in print format
@ -184,7 +184,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
} }
} }
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm); erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm);
} }
make_maintenance_schedule() { make_maintenance_schedule() {

View File

@ -395,7 +395,7 @@ class SalesInvoice(SellingController):
"Repost Payment Ledger Items", "Repost Payment Ledger Items",
"Repost Accounting Ledger", "Repost Accounting Ledger",
"Repost Accounting Ledger Items", "Repost Accounting Ledger Items",
"Unreconcile Payments", "Unreconcile Payment",
"Unreconcile Payment Entries", "Unreconcile Payment Entries",
"Payment Ledger Entry", "Payment Ledger Entry",
"Serial and Batch Bundle", "Serial and Batch Bundle",

View File

@ -10,7 +10,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase): class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
def setUp(self): def setUp(self):
self.create_company() self.create_company()
self.create_customer() self.create_customer()
@ -73,7 +73,7 @@ class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase):
unreconcile = frappe.get_doc( unreconcile = frappe.get_doc(
{ {
"doctype": "Unreconcile Payments", "doctype": "Unreconcile Payment",
"company": self.company, "company": self.company,
"voucher_type": pe.doctype, "voucher_type": pe.doctype,
"voucher_no": pe.name, "voucher_no": pe.name,
@ -138,7 +138,7 @@ class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase):
unreconcile = frappe.get_doc( unreconcile = frappe.get_doc(
{ {
"doctype": "Unreconcile Payments", "doctype": "Unreconcile Payment",
"company": self.company, "company": self.company,
"voucher_type": pe2.doctype, "voucher_type": pe2.doctype,
"voucher_no": pe2.name, "voucher_no": pe2.name,
@ -196,7 +196,7 @@ class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase):
unreconcile = frappe.get_doc( unreconcile = frappe.get_doc(
{ {
"doctype": "Unreconcile Payments", "doctype": "Unreconcile Payment",
"company": self.company, "company": self.company,
"voucher_type": pe.doctype, "voucher_type": pe.doctype,
"voucher_no": pe.name, "voucher_no": pe.name,
@ -281,7 +281,7 @@ class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase):
unreconcile = frappe.get_doc( unreconcile = frappe.get_doc(
{ {
"doctype": "Unreconcile Payments", "doctype": "Unreconcile Payment",
"company": self.company, "company": self.company,
"voucher_type": pe2.doctype, "voucher_type": pe2.doctype,
"voucher_no": pe2.name, "voucher_no": pe2.name,

View File

@ -1,7 +1,7 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Unreconcile Payments", { frappe.ui.form.on("Unreconcile Payment", {
refresh(frm) { refresh(frm) {
frm.set_query("voucher_type", function() { frm.set_query("voucher_type", function() {
return { return {

View File

@ -21,7 +21,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Amended From", "label": "Amended From",
"no_copy": 1, "no_copy": 1,
"options": "Unreconcile Payments", "options": "Unreconcile Payment",
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
}, },
@ -61,7 +61,7 @@
"modified": "2023-08-28 17:42:50.261377", "modified": "2023-08-28 17:42:50.261377",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Unreconcile Payments", "name": "Unreconcile Payment",
"naming_rule": "Expression", "naming_rule": "Expression",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [

View File

@ -15,7 +15,7 @@ from erpnext.accounts.utils import (
) )
class UnreconcilePayments(Document): class UnreconcilePayment(Document):
def validate(self): def validate(self):
self.supported_types = ["Payment Entry", "Journal Entry"] self.supported_types = ["Payment Entry", "Journal Entry"]
if not self.voucher_type in self.supported_types: if not self.voucher_type in self.supported_types:
@ -142,7 +142,7 @@ def create_unreconcile_doc_for_selection(selections=None):
selections = frappe.json.loads(selections) selections = frappe.json.loads(selections)
# assuming each row is a unique voucher # assuming each row is a unique voucher
for row in selections: for row in selections:
unrecon = frappe.new_doc("Unreconcile Payments") unrecon = frappe.new_doc("Unreconcile Payment")
unrecon.company = row.get("company") unrecon.company = row.get("company")
unrecon.voucher_type = row.get("voucher_type") unrecon.voucher_type = row.get("voucher_type")
unrecon.voucher_no = row.get("voucher_no") unrecon.voucher_no = row.get("voucher_no")

View File

@ -239,7 +239,7 @@ class AccountsController(TransactionBase):
references_map.setdefault(x.parent, []).append(x.name) references_map.setdefault(x.parent, []).append(x.name)
for doc, rows in references_map.items(): for doc, rows in references_map.items():
unreconcile_doc = frappe.get_doc("Unreconcile Payments", doc) unreconcile_doc = frappe.get_doc("Unreconcile Payment", doc)
for row in rows: for row in rows:
unreconcile_doc.remove(unreconcile_doc.get("allocations", {"name": row})[0]) unreconcile_doc.remove(unreconcile_doc.get("allocations", {"name": row})[0])
@ -248,9 +248,9 @@ class AccountsController(TransactionBase):
unreconcile_doc.save(ignore_permissions=True) unreconcile_doc.save(ignore_permissions=True)
# delete docs upon parent doc deletion # delete docs upon parent doc deletion
unreconcile_docs = frappe.db.get_all("Unreconcile Payments", filters={"voucher_no": self.name}) unreconcile_docs = frappe.db.get_all("Unreconcile Payment", filters={"voucher_no": self.name})
for x in unreconcile_docs: for x in unreconcile_docs:
_doc = frappe.get_doc("Unreconcile Payments", x.name) _doc = frappe.get_doc("Unreconcile Payment", x.name)
if _doc.docstatus == 1: if _doc.docstatus == 1:
_doc.cancel() _doc.cancel()
_doc.delete() _doc.delete()

View File

@ -1,6 +1,6 @@
frappe.provide('erpnext.accounts'); frappe.provide('erpnext.accounts');
erpnext.accounts.unreconcile_payments = { erpnext.accounts.unreconcile_payment = {
add_unreconcile_btn(frm) { add_unreconcile_btn(frm) {
if (frm.doc.docstatus == 1) { if (frm.doc.docstatus == 1) {
if(((frm.doc.doctype == "Journal Entry") && (frm.doc.voucher_type != "Journal Entry")) if(((frm.doc.doctype == "Journal Entry") && (frm.doc.voucher_type != "Journal Entry"))
@ -10,7 +10,7 @@ erpnext.accounts.unreconcile_payments = {
} }
frappe.call({ frappe.call({
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_references", "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.doc_has_references",
"args": { "args": {
"doctype": frm.doc.doctype, "doctype": frm.doc.doctype,
"docname": frm.doc.name "docname": frm.doc.name
@ -18,7 +18,7 @@ erpnext.accounts.unreconcile_payments = {
callback: function(r) { callback: function(r) {
if (r.message) { if (r.message) {
frm.add_custom_button(__("UnReconcile"), function() { frm.add_custom_button(__("UnReconcile"), function() {
erpnext.accounts.unreconcile_payments.build_unreconcile_dialog(frm); erpnext.accounts.unreconcile_payment.build_unreconcile_dialog(frm);
}, __('Actions')); }, __('Actions'));
} }
} }
@ -74,7 +74,7 @@ erpnext.accounts.unreconcile_payments = {
// get linked payments // get linked payments
frappe.call({ frappe.call({
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.get_linked_payments_for_doc", "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.get_linked_payments_for_doc",
"args": { "args": {
"company": frm.doc.company, "company": frm.doc.company,
"doctype": frm.doc.doctype, "doctype": frm.doc.doctype,
@ -96,8 +96,8 @@ erpnext.accounts.unreconcile_payments = {
let selected_allocations = values.allocations.filter(x=>x.__checked); let selected_allocations = values.allocations.filter(x=>x.__checked);
if (selected_allocations.length > 0) { if (selected_allocations.length > 0) {
let selection_map = erpnext.accounts.unreconcile_payments.build_selection_map(frm, selected_allocations); let selection_map = erpnext.accounts.unreconcile_payment.build_selection_map(frm, selected_allocations);
erpnext.accounts.unreconcile_payments.create_unreconcile_docs(selection_map); erpnext.accounts.unreconcile_payment.create_unreconcile_docs(selection_map);
d.hide(); d.hide();
} else { } else {
@ -115,7 +115,7 @@ erpnext.accounts.unreconcile_payments = {
create_unreconcile_docs(selection_map) { create_unreconcile_docs(selection_map) {
frappe.call({ frappe.call({
"method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.create_unreconcile_doc_for_selection", "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.create_unreconcile_doc_for_selection",
"args": { "args": {
"selections": selection_map "selections": selection_map
}, },