mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
refactored get_value and added backlink check in 'cancel'
This commit is contained in:
@@ -108,6 +108,8 @@ class DocType(SellingController):
|
|||||||
self.update_time_log_batch(self.doc.name)
|
self.update_time_log_batch(self.doc.name)
|
||||||
self.convert_to_recurring()
|
self.convert_to_recurring()
|
||||||
|
|
||||||
|
def before_cancel(self):
|
||||||
|
self.update_time_log_batch(None)
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
if cint(self.doc.is_pos) == 1:
|
if cint(self.doc.is_pos) == 1:
|
||||||
@@ -123,7 +125,6 @@ class DocType(SellingController):
|
|||||||
self.check_next_docstatus()
|
self.check_next_docstatus()
|
||||||
sales_com_obj.update_prevdoc_detail(0, self)
|
sales_com_obj.update_prevdoc_detail(0, self)
|
||||||
|
|
||||||
self.update_time_log_batch(None)
|
|
||||||
self.make_gl_entries(is_cancel=1)
|
self.make_gl_entries(is_cancel=1)
|
||||||
|
|
||||||
def on_update_after_submit(self):
|
def on_update_after_submit(self):
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
tlb = webnotes.bean("Time Log Batch", "_T-Time Log Batch-00001")
|
tlb = webnotes.bean("Time Log Batch", "_T-Time Log Batch-00001")
|
||||||
tlb.submit()
|
tlb.submit()
|
||||||
|
|
||||||
w = webnotes.bean(webnotes.copy_doclist(test_records[0]))
|
si = webnotes.bean(webnotes.copy_doclist(test_records[0]))
|
||||||
w.doclist[1].time_log_batch = "_T-Time Log Batch-00001"
|
si.doclist[1].time_log_batch = "_T-Time Log Batch-00001"
|
||||||
w.insert()
|
si.insert()
|
||||||
w.submit()
|
si.submit()
|
||||||
|
|
||||||
self.assertEquals(webnotes.conn.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"),
|
self.assertEquals(webnotes.conn.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"),
|
||||||
"Billed")
|
"Billed")
|
||||||
@@ -44,7 +44,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
self.assertEquals(webnotes.conn.get_value("Time Log", "_T-Time Log-00001", "status"),
|
self.assertEquals(webnotes.conn.get_value("Time Log", "_T-Time Log-00001", "status"),
|
||||||
"Billed")
|
"Billed")
|
||||||
|
|
||||||
w.cancel()
|
si.cancel()
|
||||||
|
|
||||||
self.assertEquals(webnotes.conn.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"),
|
self.assertEquals(webnotes.conn.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"),
|
||||||
"Submitted")
|
"Submitted")
|
||||||
|
|||||||
@@ -203,4 +203,5 @@ patch_list = [
|
|||||||
"execute:(not webnotes.conn.exists('UOM', 'Hour')) and webnotes.doc({'uom_name': 'Unit', 'doctype': 'UOM', 'name': 'Hour'}).insert()",
|
"execute:(not webnotes.conn.exists('UOM', 'Hour')) and webnotes.doc({'uom_name': 'Unit', 'doctype': 'UOM', 'name': 'Hour'}).insert()",
|
||||||
"patches.february_2013.p09_remove_cancelled_warehouses",
|
"patches.february_2013.p09_remove_cancelled_warehouses",
|
||||||
"patches.march_2013.update_po_prevdoc_doctype",
|
"patches.march_2013.update_po_prevdoc_doctype",
|
||||||
|
"patches.february_2013.p09_timesheets",
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user