Planned Start Date made mandatory in production order

server side check added to not plan operations if planned_start_date is None
Production Order on submit - unwanted error messsages problem fixed.
This commit is contained in:
Neil Trini Lasrado 2015-04-01 17:31:12 +05:30
parent 2c78796716
commit 8d5d5cc0a7
2 changed files with 6 additions and 4 deletions

View File

@ -172,7 +172,8 @@
"fieldtype": "Datetime",
"label": "Planned Start Date",
"permlevel": 0,
"precision": ""
"precision": "",
"reqd": 1
},
{
"fieldname": "planned_end_date",
@ -354,8 +355,8 @@
"icon": "icon-cogs",
"idx": 1,
"in_create": 0,
"is_submittable": 1,
"modified": "2015-03-10 17:02:28.401930",
"is_submittable": 1,
"modified": "2015-04-01 07:32:38.426624",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",

View File

@ -201,7 +201,7 @@ class ProductionOrder(Document):
Planned Start Date. Time logs will be created and remain in Draft mode and must be submitted
before manufacturing entry can be made."""
if not self.operations:
if not self.operations and not self.planned_start_date:
return
time_logs = []
@ -248,6 +248,7 @@ class ProductionOrder(Document):
self.planned_end_date = self.operations[-1].planned_end_time
if time_logs:
frappe.local.message_log = []
frappe.msgprint(_("Time Logs created:") + "\n" + "\n".join(time_logs))
def set_operation_start_end_time(self, i, d):