fix(payments): incoming payment requests aren't supposed to be in 'initiated' state (only outgoing are) (#37447)
* fix(payments): incoming payment requests aren't supposed to be in 'initiated' state (only outgoing are) * fixup! fix(payments): incoming payment requests aren't supposed to be in 'initiated' state (only outgoing are)
This commit is contained in:
parent
45b4bfc947
commit
922fffda1f
@ -175,13 +175,6 @@ class PaymentRequest(Document):
|
|||||||
if self.payment_url:
|
if self.payment_url:
|
||||||
self.db_set("payment_url", self.payment_url)
|
self.db_set("payment_url", self.payment_url)
|
||||||
|
|
||||||
if (
|
|
||||||
self.payment_url
|
|
||||||
or not self.payment_gateway_account
|
|
||||||
or (self.payment_gateway_account and self.payment_channel == "Phone")
|
|
||||||
):
|
|
||||||
self.db_set("status", "Initiated")
|
|
||||||
|
|
||||||
def get_payment_url(self):
|
def get_payment_url(self):
|
||||||
if self.reference_doctype != "Fees":
|
if self.reference_doctype != "Fees":
|
||||||
data = frappe.db.get_value(
|
data = frappe.db.get_value(
|
||||||
|
@ -338,6 +338,7 @@ erpnext.patches.v15_0.delete_woocommerce_settings_doctype
|
|||||||
erpnext.patches.v14_0.migrate_deferred_accounts_to_item_defaults
|
erpnext.patches.v14_0.migrate_deferred_accounts_to_item_defaults
|
||||||
erpnext.patches.v14_0.update_invoicing_period_in_subscription
|
erpnext.patches.v14_0.update_invoicing_period_in_subscription
|
||||||
execute:frappe.delete_doc("Page", "welcome-to-erpnext")
|
execute:frappe.delete_doc("Page", "welcome-to-erpnext")
|
||||||
|
erpnext.patches.v15_0.migrate_payment_request_status
|
||||||
erpnext.patches.v15_0.delete_payment_gateway_doctypes
|
erpnext.patches.v15_0.delete_payment_gateway_doctypes
|
||||||
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
|
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
|
||||||
erpnext.patches.v15_0.update_sre_from_voucher_details
|
erpnext.patches.v15_0.update_sre_from_voucher_details
|
||||||
|
15
erpnext/patches/v15_0/migrate_payment_request_status.py
Normal file
15
erpnext/patches/v15_0/migrate_payment_request_status.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
Description:
|
||||||
|
Change Inward Payment Requests from statut 'Initiated' to correct status 'Requested'.
|
||||||
|
Status 'Initiated' is reserved for Outward Payment Requests and was a semantic error in previour versions.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if frappe.reload_doc("accounts", "doctype", "Payment Request"):
|
||||||
|
so = frappe.qb.DocType("Payment Request")
|
||||||
|
frappe.qb.update(so).set(so.status, "Requested").where(
|
||||||
|
so.payment_request_type == "Inward"
|
||||||
|
).where(so.status == "Initiated").run()
|
Loading…
x
Reference in New Issue
Block a user