mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-07 19:51:45 +00:00
fix: set Required By on Purchase Orders created per supplier
Mapping drops a schedule date that already passed, leaving the buyer to pick a
new one on the Purchase Order form. Nothing fills it in when the orders are
created straight from the supplier selection dialog, so a Material Request
whose required date has gone by failed to save with "Please enter the Required
By".
Items that lose their date now fall back to today, which is the earliest date a
Purchase Order raised today accepts.
(cherry picked from commit d05bd80b1e)
This commit is contained in:
@@ -236,6 +236,9 @@ def make_purchase_orders_by_supplier(source_name: str, item_suppliers: str | lis
|
||||
"requested_qty": requested_qty,
|
||||
},
|
||||
)
|
||||
for item in purchase_order.items:
|
||||
item.schedule_date = item.schedule_date or nowdate()
|
||||
|
||||
purchase_order.insert()
|
||||
purchase_orders.append(purchase_order.name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user