Browse Source

Update status in Purchase Receipt (#14257)

* Update status on submission if per_billed = 100

* Add patch to update existing records
develop
Shreya Shah 6 years ago
committed by Nabin Hait
parent
commit
ae95a8aa15
  1. 1
      erpnext/patches.txt
  2. 7
      erpnext/patches/v10_0/update_status_in_purchase_receipt.py
  3. 2
      erpnext/stock/doctype/purchase_receipt/purchase_receipt.py

1
erpnext/patches.txt

@ -502,3 +502,4 @@ erpnext.patches.v10_0.fix_reserved_qty_for_sub_contract
erpnext.patches.v10_0.taxes_issue_with_pos
erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input
erpnext.patches.v10_0.show_leaves_of_all_department_members_in_calendar
erpnext.patches.v10_0.update_status_in_purchase_receipt

7
erpnext/patches/v10_0/update_status_in_purchase_receipt.py

@ -0,0 +1,7 @@
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
''')

2
erpnext/stock/doctype/purchase_receipt/purchase_receipt.py

@ -120,6 +120,8 @@ class PurchaseReceipt(BuyingController):
self.update_prevdoc_status()
if self.per_billed < 100:
self.update_billing_status()
else:
self.status = "Completed"
# Updating stock ledger should always be called after updating prevdoc status,
# because updating ordered qty, reserved_qty_for_subcontract in bin

Loading…
Cancel
Save