From 4bb6db86f80085eb7dba0c0d31e9960f285ff856 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 24 Jul 2023 12:29:57 +0530 Subject: [PATCH] fix: Remove auto repeat (subscription) button from Sales and Purchase documents --- .../accounts/doctype/purchase_invoice/purchase_invoice.js | 6 ------ erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 6 ------ erpnext/buying/doctype/purchase_order/purchase_order.js | 6 ------ erpnext/selling/doctype/quotation/quotation.js | 6 ------ erpnext/selling/doctype/sales_order/sales_order.js | 6 ------ erpnext/stock/doctype/delivery_note/delivery_note.js | 6 ------ erpnext/stock/doctype/purchase_receipt/purchase_receipt.js | 6 ------ 7 files changed, 42 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 6a558ca606..19e4e4239f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -97,12 +97,6 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. cur_frm.add_custom_button(__('Return / Debit Note'), this.make_debit_note, __('Create')); } - - if(!doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } } if (doc.outstanding_amount > 0 && !cint(doc.is_return) && !doc.on_hold) { diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 8753ebc3ba..1ac162f9d8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -154,12 +154,6 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e cur_frm.cscript.make_maintenance_schedule(); }, __('Create')); } - - if(!doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } } // Show buttons only when pos view is active diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 8fa8f30554..fb3325b709 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -248,12 +248,6 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends e function() { me.make_payment_request() }, __('Create')); } - if(!doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } - if (doc.docstatus === 1 && !doc.inter_company_order_reference) { let me = this; let internal = me.frm.doc.is_internal_supplier; diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 67c392cc3f..3e26a67d0d 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -124,12 +124,6 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext. }); } - if(!doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } - cur_frm.page.set_inner_btn_group_as_primary(__('Create')); } diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 5d43a07d96..47e976f00b 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -375,12 +375,6 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex this.frm.add_custom_button(__('Project'), () => this.make_project(), __('Create')); } - if(!doc.auto_repeat) { - this.frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } - if (doc.docstatus === 1 && !doc.inter_company_order_reference) { let me = this; let internal = me.frm.doc.is_internal_customer; diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index a648195933..1f290a590a 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -232,12 +232,6 @@ erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpn __("Status")) } erpnext.stock.delivery_note.set_print_hide(doc, dt, dn); - - if(doc.docstatus==1 && !doc.is_return && !doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(doc.doctype, doc.name) - }, __('Create')) - } } make_shipment() { diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 35aad78c1a..e66340a8f7 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -187,12 +187,6 @@ erpnext.stock.PurchaseReceiptController = class PurchaseReceiptController extend } cur_frm.add_custom_button(__('Retention Stock Entry'), this.make_retention_stock_entry, __('Create')); - if(!this.frm.doc.auto_repeat) { - cur_frm.add_custom_button(__('Subscription'), function() { - erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name) - }, __('Create')) - } - cur_frm.page.set_inner_btn_group_as_primary(__('Create')); } }