Exemplo n.º 1
0
	def check_for_closed_status(self):
		check_list =[]
		for d in self.get('items'):
			if (d.meta.get_field('purchase_order') and d.purchase_order
				and d.purchase_order not in check_list):
				check_list.append(d.purchase_order)
				check_for_closed_status('Purchase Order', d.purchase_order)
Exemplo n.º 2
0
	def check_for_closed_status(self):
		check_list = []

		for d in self.get('items'):
			if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
				check_list.append(d.purchase_order)
				check_for_closed_status('Purchase Order', d.purchase_order)
Exemplo n.º 3
0
 def check_for_closed_status(self):
     check_list = []
     for d in self.get('items'):
         if (d.meta.get_field('purchase_order') and d.purchase_order
                 and d.purchase_order not in check_list):
             check_list.append(d.purchase_order)
             check_for_closed_status('Purchase Order', d.purchase_order)
Exemplo n.º 4
0
	def check_for_closed_status(self):
		check_list = []

		for d in self.get('items'):
			if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
				check_list.append(d.purchase_order)
				check_for_closed_status('Purchase Order', d.purchase_order)
Exemplo n.º 5
0
 def check_for_closed_status(self):
     check_list = []
     for d in self.get('items'):
         if d.meta.get_field(
                 'material_request'
         ) and d.material_request and d.material_request not in check_list:
             check_list.append(d.material_request)
             check_for_closed_status('Material Request', d.material_request)
Exemplo n.º 6
0
 def before_cancel(self):
     # if MRQ is already closed, no point saving the document
     check_for_closed_status(self.doctype, self.name)
     self.set_status(update=True, status='Cancelled')
Exemplo n.º 7
0
	def check_for_closed_status(self):
		check_list =[]
		for d in self.get('items'):
			if d.meta.get_field('material_request') and d.material_request and d.material_request not in check_list:
				check_list.append(d.material_request)
				check_for_closed_status('Material Request', d.material_request)
Exemplo n.º 8
0
	def before_cancel(self):
		# if MRQ is already closed, no point saving the document
		check_for_closed_status(self.doctype, self.name)
		self.set_status(update=True, status='Cancelled')
    def on_cancel(self):
        check_for_closed_status(self.doctype, self.name)

        self.update_requested_qty()

        frappe.db.set(self, 'status', 'Cancelled')