fix: po status

This commit is contained in:
Nabin Hait 2019-05-22 11:55:39 +05:30
parent d752051b8d
commit 915edbf9ce

View File

@ -336,7 +336,8 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None):
def postprocess(source, target_doc):
target_doc.supplier = source_name
target_doc.schedule_date = add_days(nowdate(), 1)
if getdate(target_doc.schedule_date) < getdate(nowdate()):
target_doc.schedule_date = None
target_doc.set("items", [d for d in target_doc.get("items")
if d.get("item_code") in supplier_items and d.get("qty") > 0])