2021-04-17 15:42:03 +05:30
|
|
|
import frappe
|
|
|
|
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2021-04-17 15:42:03 +05:30
|
|
|
def execute():
|
|
|
|
frappe.reload_doc("stock", "doctype", "shipment")
|
|
|
|
|
|
|
|
# update submitted status
|
2022-03-28 18:52:46 +05:30
|
|
|
frappe.db.sql(
|
|
|
|
"""UPDATE `tabShipment`
|
2021-04-17 15:42:03 +05:30
|
|
|
SET status = "Submitted"
|
2022-03-28 18:52:46 +05:30
|
|
|
WHERE status = "Draft" AND docstatus = 1"""
|
|
|
|
)
|
2021-04-17 15:42:03 +05:30
|
|
|
|
|
|
|
# update cancelled status
|
2022-03-28 18:52:46 +05:30
|
|
|
frappe.db.sql(
|
|
|
|
"""UPDATE `tabShipment`
|
2021-04-17 15:42:03 +05:30
|
|
|
SET status = "Cancelled"
|
2022-03-28 18:52:46 +05:30
|
|
|
WHERE status = "Draft" AND docstatus = 2"""
|
|
|
|
)
|