Fixed reserved qty for production logic and patch for reposting (#11691)

This commit is contained in:
Nabin Hait 2017-11-23 13:05:43 +05:30 committed by GitHub
parent a90274fed9
commit cda4d50063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -461,3 +461,4 @@ execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
erpnext.patches.v9_0.update_employee_loan_details
erpnext.patches.v9_2.delete_healthcare_domain_default_items
erpnext.patches.v9_2.rename_translated_domains_in_en
erpnext.patches.v9_2.repost_reserved_qty_for_production

View File

@ -0,0 +1,7 @@
import frappe
def execute():
bins = frappe.db.sql("select name from `tabBin` where reserved_qty_for_production > 0")
for d in bins:
bin_doc = frappe.get_doc("Bin", d[0])
bin_doc.update_reserved_qty_for_production()

View File

@ -88,11 +88,10 @@ class Bin(Document):
and item.source_warehouse = %s
and pro.status not in ("Stopped", "Completed")''', (self.item_code, self.warehouse))[0][0]
if self.reserved_qty_for_production:
self.set_projected_qty()
self.set_projected_qty()
self.db_set('reserved_qty_for_production', self.reserved_qty_for_production)
self.db_set('projected_qty', self.projected_qty)
self.db_set('reserved_qty_for_production', flt(self.reserved_qty_for_production))
self.db_set('projected_qty', self.projected_qty)
def update_item_projected_qty(item_code):