Moved flags like ignore_mandatory, ignore_validate etc to doc.flags

This commit is contained in:
Anand Doshi
2015-02-10 14:41:27 +05:30
parent 2813f38c5a
commit 6dfd430a2f
29 changed files with 54 additions and 53 deletions

View File

@@ -110,7 +110,7 @@ class TimeLog(Document):
tl.hours, self.production_order, operation[0], operation[1]))
pro_order = frappe.get_doc("Production Order", self.production_order)
pro_order.ignore_validate_update_after_submit = True
pro_order.flags.ignore_validate_update_after_submit = True
pro_order.update_operation_status()
pro_order.calculate_operating_cost()
pro_order.set_actual_dates()
@@ -129,14 +129,14 @@ class TimeLog(Document):
from `tabTime Log`
where production_order = %s and operation = %s and docstatus=1""",
(self.production_order, self.operation), as_dict=1)[0]
def validate_project(self):
if self.time_log_for == 'Project':
if not self.project:
frappe.throw(_("Project is Mandatory."))
if self.time_log_for == "":
self.project = None
self.project = None
def validate_manufacturing(self):
if self.time_log_for == 'Manufacturing':
if not self.production_order:

View File

@@ -57,7 +57,7 @@ class TimeLogBatch(Document):
tl = frappe.get_doc("Time Log", d.time_log)
tl.time_log_batch = time_log_batch
tl.sales_invoice = self.sales_invoice
tl.ignore_validate_update_after_submit = True
tl.flags.ignore_validate_update_after_submit = True
tl.save()
@frappe.whitelist()