[Fix] Subscription method (#14604)
* [Fix] Subscription method path * [Fix] Condition
This commit is contained in:
parent
4d80c05125
commit
79e5b07e62
@ -71,7 +71,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
this.make_debit_note, __("Make"));
|
this.make_debit_note, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.subscription) {
|
if(!doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -88,7 +88,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
this.make_payment_request, __("Make"));
|
this.make_payment_request, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.subscription) {
|
if(!doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -125,7 +125,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
|||||||
cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_payment_entry, __("Make"));
|
cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_payment_entry, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.subscription) {
|
if(!doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -22,9 +22,12 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
|
|||||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||||
cur_frm.add_custom_button(__("Quotation"), this.make_quotation,
|
cur_frm.add_custom_button(__("Quotation"), this.make_quotation,
|
||||||
__("Make"));
|
__("Make"));
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
|
||||||
erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name)
|
if(!this.frm.doc.auto_repeat) {
|
||||||
}, __("Make"))
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
|
erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name)
|
||||||
|
}, __("Make"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (this.frm.doc.docstatus===0) {
|
else if (this.frm.doc.docstatus===0) {
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ $.extend(erpnext.utils, {
|
|||||||
|
|
||||||
make_subscription: function(doctype, docname) {
|
make_subscription: function(doctype, docname) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.accounts.doctype.subscription.subscription.make_subscription",
|
method: "frappe.desk.doctype.auto_repeat.auto_repeat.make_auto_repeat",
|
||||||
args: {
|
args: {
|
||||||
doctype: doctype,
|
doctype: doctype,
|
||||||
docname: docname
|
docname: docname
|
||||||
|
@ -60,7 +60,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
cur_frm.cscript['Declare Order Lost']);
|
cur_frm.cscript['Declare Order Lost']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.subscription) {
|
if(!doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -158,7 +158,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
function() { me.make_project() }, __("Make"));
|
function() { me.make_project() }, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.subscription) {
|
if(!doc.auto_repeat) {
|
||||||
this.frm.add_custom_button(__('Subscription'), function() {
|
this.frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -167,7 +167,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
|||||||
}
|
}
|
||||||
erpnext.stock.delivery_note.set_print_hide(doc, dt, dn);
|
erpnext.stock.delivery_note.set_print_hide(doc, dt, dn);
|
||||||
|
|
||||||
if(doc.docstatus==1 && !doc.subscription) {
|
if(doc.docstatus==1 && !doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
erpnext.utils.make_subscription(doc.doctype, doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
@ -117,7 +117,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
}
|
}
|
||||||
cur_frm.add_custom_button(__('Retention Stock Entry'), this.make_retention_stock_entry, __("Make"));
|
cur_frm.add_custom_button(__('Retention Stock Entry'), this.make_retention_stock_entry, __("Make"));
|
||||||
|
|
||||||
if(!this.frm.doc.subscription) {
|
if(!this.frm.doc.auto_repeat) {
|
||||||
cur_frm.add_custom_button(__('Subscription'), function() {
|
cur_frm.add_custom_button(__('Subscription'), function() {
|
||||||
erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name)
|
erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name)
|
||||||
}, __("Make"))
|
}, __("Make"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user