fix(payment gateway account): add patch to set the payment channel as email
This commit is contained in:
parent
c66fce4965
commit
ebb8ee3dc6
@ -25,7 +25,7 @@ frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
|
|||||||
})
|
})
|
||||||
|
|
||||||
frappe.ui.form.on("Payment Request", "refresh", function(frm) {
|
frappe.ui.form.on("Payment Request", "refresh", function(frm) {
|
||||||
if(frm.doc.payment_request_type == 'Inward' && frm.doc.payment_channel === "Phone" &&
|
if(frm.doc.payment_request_type == 'Inward' && frm.doc.payment_channel !== "Phone" &&
|
||||||
!in_list(["Initiated", "Paid"], frm.doc.status) && !frm.doc.__islocal && frm.doc.docstatus==1){
|
!in_list(["Initiated", "Paid"], frm.doc.status) && !frm.doc.__islocal && frm.doc.docstatus==1){
|
||||||
frm.add_custom_button(__('Resend Payment Email'), function(){
|
frm.add_custom_button(__('Resend Payment Email'), function(){
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
@ -729,3 +729,4 @@ erpnext.patches.v13_0.setting_custom_roles_for_some_regional_reports
|
|||||||
erpnext.patches.v13_0.rename_issue_doctype_fields
|
erpnext.patches.v13_0.rename_issue_doctype_fields
|
||||||
erpnext.patches.v13_0.change_default_pos_print_format
|
erpnext.patches.v13_0.change_default_pos_print_format
|
||||||
erpnext.patches.v13_0.set_youtube_video_id
|
erpnext.patches.v13_0.set_youtube_video_id
|
||||||
|
erpnext.patches.v13_0.set_payment_channel_in_payment_gateway_account
|
@ -0,0 +1,17 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
"""Set the payment gateway account as Email for all the existing payment channel."""
|
||||||
|
doc_meta = frappe.get_meta("Payment Gateway Account")
|
||||||
|
if doc_meta.get_field("payment_channel"):
|
||||||
|
return
|
||||||
|
|
||||||
|
frappe.reload_doc("Accounts", "doctype", "Payment Gateway Account")
|
||||||
|
set_payment_channel_as_email()
|
||||||
|
|
||||||
|
def set_payment_channel_as_email():
|
||||||
|
frappe.db.sql("""
|
||||||
|
UPDATE `tabPayment Gateway Account`
|
||||||
|
SET `payment_channel` = "Email"
|
||||||
|
""")
|
Loading…
x
Reference in New Issue
Block a user