mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
set schedule_Date when creating po
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.utils import cstr, flt, getdate, new_line_sep
|
||||
from frappe.utils import cstr, flt, getdate, new_line_sep, nowdate, add_days
|
||||
from frappe import msgprint, _
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty
|
||||
@@ -228,6 +228,7 @@ def update_item(obj, target, source_parent):
|
||||
@frappe.whitelist()
|
||||
def make_purchase_order(source_name, target_doc=None):
|
||||
def postprocess(source, target_doc):
|
||||
target_doc.schedule_Date = add_days(nowdate(), 1)
|
||||
set_missing_values(source, target_doc)
|
||||
|
||||
doclist = get_mapped_doc("Material Request", source_name, {
|
||||
@@ -287,6 +288,7 @@ 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)
|
||||
|
||||
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])
|
||||
|
||||
Reference in New Issue
Block a user