mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-13 15:27:12 +00:00
Merge pull request #2724 from neilLasrado/planned-start-date
validations added to production order
This commit is contained in:
@@ -35,6 +35,7 @@ class ProductionOrder(Document):
|
||||
self.validate_sales_order()
|
||||
self.validate_warehouse()
|
||||
self.calculate_operating_cost()
|
||||
self.validate_delivery_date()
|
||||
|
||||
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||
validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"])
|
||||
@@ -219,6 +220,13 @@ class ProductionOrder(Document):
|
||||
else:
|
||||
self.actual_start_date = None
|
||||
self.actual_end_date = None
|
||||
|
||||
def validate_delivery_date(self):
|
||||
if self.planned_start_date and self.expected_delivery_date and getdate(self.expected_delivery_date) < getdate(self.planned_start_date):
|
||||
frappe.throw(_("Expected Delivery Date cannot be greater than Planned Start Date"))
|
||||
|
||||
if self.planned_end_date and self.expected_delivery_date and getdate(self.expected_delivery_date) < getdate(self.planned_end_date):
|
||||
frappe.msgprint(_("Production might not be able to finish by the Expected Delivery Date."))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_item_details(item):
|
||||
|
||||
Reference in New Issue
Block a user