Пример #1
0
def process_workflow_actions(doc, state):
	workflow = get_workflow_name(doc.get('doctype'))
	if not workflow: return

	if state == "on_trash":
		clear_workflow_actions(doc.get('doctype'), doc.get('name'))
		return

	if is_workflow_action_already_created(doc): return

	clear_old_workflow_actions(doc)
	update_completed_workflow_actions(doc)
	clear_doctype_notifications('Workflow Action')

	next_possible_transitions = get_next_possible_transitions(workflow, get_doc_workflow_state(doc))

	if not next_possible_transitions: return

	user_data_map = get_users_next_action_data(next_possible_transitions, doc)

	if not user_data_map: return

	create_workflow_actions_for_users(user_data_map.keys(), doc)

	if send_email_alert(workflow):
		enqueue(send_workflow_action_email, queue='short', users_data=list(user_data_map.values()), doc=doc)
Пример #2
0
	def update_status(self, status):
		self.check_modified_date()
		self.set_status(update=True, status=status)
		self.update_requested_qty()
		self.update_ordered_qty()
		self.notify_update()
		clear_doctype_notifications(self)
Пример #3
0
	def stop_sales_order(self):
		self.check_modified_date()
		frappe.db.set(self, 'status', 'Stopped')
		self.update_reserved_qty()
		frappe.msgprint(_("{0} {1} status is Stopped").format(self.doctype, self.name))
		self.notify_modified()
		clear_doctype_notifications(self)
Пример #4
0
	def update_status(self, status):
		self.check_modified_date()
		self.set_status(update=True, status=status)
		self.update_requested_qty()
		self.update_ordered_qty()
		if self.is_subcontracted == "Yes":
			self.update_reserved_qty_for_subcontract()

		self.notify_update()
		clear_doctype_notifications(self)
Пример #5
0
	def update_status(self, status):
		self.check_modified_date()
		frappe.db.set(self,'status',cstr(status))

		self.update_requested_qty()
		self.update_ordered_qty()

		msgprint(_("Status of {0} {1} is now {2}").format(self.doctype, self.name, status))
		self.notify_update()
		clear_doctype_notifications(self)
Пример #6
0
	def update_status(self, status):
		self.set_status(update=True, status = status)
		self.notify_update()
		clear_doctype_notifications(self)
Пример #7
0
	def unstop_sales_order(self):
		self.check_modified_date()
		self.db_set('status', 'Draft')
		self.set_status(update=True)
		self.update_reserved_qty()
		clear_doctype_notifications(self)
Пример #8
0
	def stop_sales_order(self):
		self.check_modified_date()
		self.db_set('status', 'Stopped')
		self.update_reserved_qty()
		self.notify_update()
		clear_doctype_notifications(self)
	def on_update(self):
		clear_doctype_notifications(self)
Пример #10
0
 def update_status(self, status):
     self.set_status(update=True, status=status)
     self.notify_update()
     clear_doctype_notifications(self)
Пример #11
0
 def update_status(self, status):
     self.check_modified_date()
     self.set_status(update=True, status=status)
     self.update_reserved_qty()
     self.notify_update()
     clear_doctype_notifications(self)
Пример #12
0
 def unstop_sales_order(self):
     self.check_modified_date()
     self.db_set('status', 'Draft')
     self.set_status(update=True)
     self.update_reserved_qty()
     clear_doctype_notifications(self)
Пример #13
0
 def stop_sales_order(self):
     self.check_modified_date()
     self.db_set('status', 'Stopped')
     self.update_reserved_qty()
     self.notify_update()
     clear_doctype_notifications(self)