From 2704162f5a2540e9e62756a32c325983f23a6d92 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Apr 2017 16:25:39 +0530 Subject: [PATCH] Fixes allowd on submit --- .../purchase_invoice_item/purchase_invoice_item.json | 4 ++-- .../doctype/sales_invoice_item/sales_invoice_item.json | 4 ++-- erpnext/selling/doctype/customer/test_customer.py | 7 ++++++- .../doctype/delivery_note_item/delivery_note_item.json | 4 ++-- .../purchase_receipt_item/purchase_receipt_item.json | 4 ++-- .../doctype/stock_entry_detail/stock_entry_detail.json | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index bf370c86845..5e964ed6255 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -1422,7 +1422,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -1939,7 +1939,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-04-17 13:44:17.460674", + "modified": "2017-04-19 11:54:16.112134", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index 205b61e8821..80f8b57fb99 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -1548,7 +1548,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -2094,7 +2094,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-04-05 23:28:13.520429", + "modified": "2017-04-19 11:53:26.682964", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 0d74d23eb4c..40ed6f98fe1 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -54,25 +54,30 @@ class TestCustomer(unittest.TestCase): self.assertEquals(value, details.get(key)) def test_rename(self): + # delete communication linked to these 2 customers for name in ("_Test Customer 1", "_Test Customer 1 Renamed"): frappe.db.sql("""delete from `tabCommunication` where communication_type='Comment' and reference_doctype=%s and reference_name=%s""", ("Customer", name)) + # add comments comment = frappe.get_doc("Customer", "_Test Customer 1").add_comment("Comment", "Test Comment for Rename") + # rename frappe.rename_doc("Customer", "_Test Customer 1", "_Test Customer 1 Renamed") + # check if customer renamed self.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed")) self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1")) - # test that comment gets renamed + # test that comment gets linked to renamed doc self.assertEquals(frappe.db.get_value("Communication", { "communication_type": "Comment", "reference_doctype": "Customer", "reference_name": "_Test Customer 1 Renamed" }), comment.name) + # rename back to original frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1") def test_freezed_customer(self): diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 2649c49c08c..9738f9c24d4 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -1644,7 +1644,7 @@ "width": "120px" }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -1894,7 +1894,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-04-05 23:26:03.390869", + "modified": "2017-04-19 11:53:42.656700", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 91d1791cc77..27b7be97c29 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1630,7 +1630,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -1979,7 +1979,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-04-05 23:27:10.785444", + "modified": "2017-04-19 11:54:00.260885", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json index 6d99dc45c24..2f7779c1327 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json @@ -1040,7 +1040,7 @@ "unique": 0 }, { - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -1225,7 +1225,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-04-05 23:25:26.885642", + "modified": "2017-04-19 11:54:31.645381", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail",