brotherton-erpnext/erpnext/patches/v10_0/update_status_in_purchase_receipt.py
Shreya Shah ae95a8aa15 Update status in Purchase Receipt (#14257)
* Update status on submission if per_billed = 100

* Add patch to update existing records
2018-05-28 18:24:28 +05:30

7 lines
210 B
Python

import frappe
def execute():
frappe.reload_doc("stock", "doctype", "purchase_receipt")
frappe.db.sql('''
UPDATE `tabPurchase Receipt` SET status = "Completed" WHERE per_billed = 100 AND docstatus = 1
''')