Merge pull request #8504 from nabinhait/allow_on_submit_fix

Fixes allowed on submit
This commit is contained in:
Nabin Hait 2017-04-19 21:11:13 +05:30 committed by GitHub
commit 00bec1c272
6 changed files with 16 additions and 11 deletions

View File

@ -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-18 18:51:33.829468",
"modified": "2017-04-19 11:54:16.112134",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@ -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",

View File

@ -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):

View File

@ -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",

View File

@ -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-18 18:50:40.551474",
"modified": "2017-04-19 11:54:00.260885",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",

View File

@ -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",