Merge pull request #8504 from nabinhait/allow_on_submit_fix
Fixes allowed on submit
This commit is contained in:
commit
00bec1c272
@ -1422,7 +1422,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@ -1939,7 +1939,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-18 18:51:33.829468",
|
"modified": "2017-04-19 11:54:16.112134",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice Item",
|
"name": "Purchase Invoice Item",
|
||||||
|
@ -1548,7 +1548,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@ -2094,7 +2094,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-05 23:28:13.520429",
|
"modified": "2017-04-19 11:53:26.682964",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice Item",
|
"name": "Sales Invoice Item",
|
||||||
|
@ -54,25 +54,30 @@ class TestCustomer(unittest.TestCase):
|
|||||||
self.assertEquals(value, details.get(key))
|
self.assertEquals(value, details.get(key))
|
||||||
|
|
||||||
def test_rename(self):
|
def test_rename(self):
|
||||||
|
# delete communication linked to these 2 customers
|
||||||
for name in ("_Test Customer 1", "_Test Customer 1 Renamed"):
|
for name in ("_Test Customer 1", "_Test Customer 1 Renamed"):
|
||||||
frappe.db.sql("""delete from `tabCommunication`
|
frappe.db.sql("""delete from `tabCommunication`
|
||||||
where communication_type='Comment' and reference_doctype=%s and reference_name=%s""",
|
where communication_type='Comment' and reference_doctype=%s and reference_name=%s""",
|
||||||
("Customer", name))
|
("Customer", name))
|
||||||
|
|
||||||
|
# add comments
|
||||||
comment = frappe.get_doc("Customer", "_Test Customer 1").add_comment("Comment", "Test Comment for Rename")
|
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")
|
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.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed"))
|
||||||
self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1"))
|
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", {
|
self.assertEquals(frappe.db.get_value("Communication", {
|
||||||
"communication_type": "Comment",
|
"communication_type": "Comment",
|
||||||
"reference_doctype": "Customer",
|
"reference_doctype": "Customer",
|
||||||
"reference_name": "_Test Customer 1 Renamed"
|
"reference_name": "_Test Customer 1 Renamed"
|
||||||
}), comment.name)
|
}), comment.name)
|
||||||
|
|
||||||
|
# rename back to original
|
||||||
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
||||||
|
|
||||||
def test_freezed_customer(self):
|
def test_freezed_customer(self):
|
||||||
|
@ -1644,7 +1644,7 @@
|
|||||||
"width": "120px"
|
"width": "120px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@ -1894,7 +1894,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-05 23:26:03.390869",
|
"modified": "2017-04-19 11:53:42.656700",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note Item",
|
"name": "Delivery Note Item",
|
||||||
|
@ -1630,7 +1630,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@ -1979,7 +1979,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-18 18:50:40.551474",
|
"modified": "2017-04-19 11:54:00.260885",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt Item",
|
"name": "Purchase Receipt Item",
|
||||||
|
@ -1040,7 +1040,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@ -1225,7 +1225,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-05 23:25:26.885642",
|
"modified": "2017-04-19 11:54:31.645381",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Entry Detail",
|
"name": "Stock Entry Detail",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user