Update sales_order.py
This commit is contained in:
parent
c4587d2945
commit
23e5d40374
@ -157,7 +157,7 @@ class SalesOrder(SellingController):
|
|||||||
self.update_reserved_qty()
|
self.update_reserved_qty()
|
||||||
|
|
||||||
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self)
|
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self)
|
||||||
|
self.update_project()
|
||||||
self.update_prevdoc_status('submit')
|
self.update_prevdoc_status('submit')
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
@ -167,11 +167,21 @@ class SalesOrder(SellingController):
|
|||||||
|
|
||||||
self.check_nextdoc_docstatus()
|
self.check_nextdoc_docstatus()
|
||||||
self.update_reserved_qty()
|
self.update_reserved_qty()
|
||||||
|
self.update_project()
|
||||||
self.update_prevdoc_status('cancel')
|
self.update_prevdoc_status('cancel')
|
||||||
|
|
||||||
frappe.db.set(self, 'status', 'Cancelled')
|
frappe.db.set(self, 'status', 'Cancelled')
|
||||||
|
|
||||||
|
def update_project(self):
|
||||||
|
project_list = []
|
||||||
|
for d in self.items:
|
||||||
|
if d.project and d.project not in project_list:
|
||||||
|
project = frappe.get_doc("Project", d.project)
|
||||||
|
project.flags.dont_sync_tasks = True
|
||||||
|
project.update_sales_costing()
|
||||||
|
project.save()
|
||||||
|
project_list.append(d.project)
|
||||||
|
|
||||||
def check_credit_limit(self):
|
def check_credit_limit(self):
|
||||||
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
||||||
check_credit_limit(self.customer, self.company)
|
check_credit_limit(self.customer, self.company)
|
||||||
|
Loading…
Reference in New Issue
Block a user