diff --git a/frappe/config/desktop.py b/frappe/config/desktop.py
index 72f3b8bafa..405435c25b 100644
--- a/frappe/config/desktop.py
+++ b/frappe/config/desktop.py
@@ -64,4 +64,10 @@ def get_data():
"system_manager": 1,
"hidden": 1
},
+ {
+ "module_name": 'Contacts',
+ "type": 'module',
+ "icon": "octicon octicon-book",
+ "color": '#FFAEDB'
+ },
]
diff --git a/frappe/email/doctype/contact/__init__.py b/frappe/contacts/__init__.py
similarity index 100%
rename from frappe/email/doctype/contact/__init__.py
rename to frappe/contacts/__init__.py
diff --git a/frappe/geo/address_and_contact.py b/frappe/contacts/address_and_contact.py
similarity index 97%
rename from frappe/geo/address_and_contact.py
rename to frappe/contacts/address_and_contact.py
index 847ea7039c..f746731754 100644
--- a/frappe/geo/address_and_contact.py
+++ b/frappe/contacts/address_and_contact.py
@@ -6,7 +6,7 @@ import frappe
def load_address_and_contact(doc, key=None):
"""Loads address list and contact list in `__onload`"""
- from frappe.geo.doctype.address.address import get_address_display
+ from frappe.contacts.doctype.address.address import get_address_display
filters = [
["Dynamic Link", "link_doctype", "=", doc.doctype],
diff --git a/frappe/geo/doctype/address/__init__.py b/frappe/contacts/doctype/__init__.py
similarity index 100%
rename from frappe/geo/doctype/address/__init__.py
rename to frappe/contacts/doctype/__init__.py
diff --git a/frappe/geo/doctype/address_template/__init__.py b/frappe/contacts/doctype/address/__init__.py
similarity index 100%
rename from frappe/geo/doctype/address_template/__init__.py
rename to frappe/contacts/doctype/address/__init__.py
diff --git a/frappe/geo/doctype/address/address.js b/frappe/contacts/doctype/address/address.js
similarity index 92%
rename from frappe/geo/doctype/address/address.js
rename to frappe/contacts/doctype/address/address.js
index 96388d11a3..f20093a21f 100644
--- a/frappe/geo/doctype/address/address.js
+++ b/frappe/contacts/doctype/address/address.js
@@ -15,7 +15,7 @@ frappe.ui.form.on("Address", {
}
frm.set_query('link_doctype', "links", function() {
return {
- query: "frappe.geo.address_and_contact.filter_dynamic_link_doctypes",
+ query: "frappe.contacts.address_and_contact.filter_dynamic_link_doctypes",
filters: {
fieldtype: "HTML",
fieldname: "address_html",
diff --git a/frappe/geo/doctype/address/address.json b/frappe/contacts/doctype/address/address.json
similarity index 99%
rename from frappe/geo/doctype/address/address.json
rename to frappe/contacts/doctype/address/address.json
index d93de0509a..a3c8bd57d4 100644
--- a/frappe/geo/doctype/address/address.json
+++ b/frappe/contacts/doctype/address/address.json
@@ -569,10 +569,11 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-03-29 12:36:56.013624",
+ "modified": "2017-04-10 13:09:45.030542",
"modified_by": "Administrator",
- "module": "Geo",
+ "module": "Contacts",
"name": "Address",
+ "name_case": "Title Case",
"owner": "Administrator",
"permissions": [
{
diff --git a/frappe/geo/doctype/address/address.py b/frappe/contacts/doctype/address/address.py
similarity index 100%
rename from frappe/geo/doctype/address/address.py
rename to frappe/contacts/doctype/address/address.py
diff --git a/frappe/contacts/doctype/address/test_address.py b/frappe/contacts/doctype/address/test_address.py
new file mode 100644
index 0000000000..d6d4e50491
--- /dev/null
+++ b/frappe/contacts/doctype/address/test_address.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe, unittest
+from frappe.contacts.doctype.address.address import get_address_display
+
+class TestAddress(unittest.TestCase):
+ def test_template_works(self):
+ if not frappe.db.exists('Address Template', 'India'):
+ frappe.get_doc({
+ "doctype": "Address Template",
+ "country": 'India',
+ "is_default": 1
+ }).insert()
+
+ if not frappe.db.exists('Address', '_Test Address-Office'):
+ frappe.get_doc({
+ "address_line1": "_Test Address Line 1",
+ "address_title": "_Test Address",
+ "address_type": "Office",
+ "city": "_Test City",
+ "state": "Test State",
+ "country": "India",
+ "doctype": "Address",
+ "is_primary_address": 1,
+ "phone": "+91 0000000000"
+ }).insert()
+
+ address = frappe.get_list("Address")[0].name
+ display = get_address_display(frappe.get_doc("Address", address).as_dict())
+ self.assertTrue(display)
\ No newline at end of file
diff --git a/frappe/geo/report/addresses_and_contacts/__init__.py b/frappe/contacts/doctype/address_template/__init__.py
similarity index 100%
rename from frappe/geo/report/addresses_and_contacts/__init__.py
rename to frappe/contacts/doctype/address_template/__init__.py
diff --git a/frappe/geo/doctype/address_template/address_template.js b/frappe/contacts/doctype/address_template/address_template.js
similarity index 79%
rename from frappe/geo/doctype/address_template/address_template.js
rename to frappe/contacts/doctype/address_template/address_template.js
index db3c68c220..502d02e7f9 100644
--- a/frappe/geo/doctype/address_template/address_template.js
+++ b/frappe/contacts/doctype/address_template/address_template.js
@@ -6,7 +6,7 @@ frappe.ui.form.on('Address Template', {
if(frm.is_new() && !frm.doc.template) {
// set default template via js so that it is translated
frappe.call({
- method: 'frappe.geo.doctype.address_template.address_template.get_default_address_template',
+ method: 'frappe.contacts.doctype.address_template.address_template.get_default_address_template',
callback: function(r) {
frm.set_value('template', r.message);
}
diff --git a/frappe/geo/doctype/address_template/address_template.json b/frappe/contacts/doctype/address_template/address_template.json
similarity index 94%
rename from frappe/geo/doctype/address_template/address_template.json
rename to frappe/contacts/doctype/address_template/address_template.json
index 8bc0c91367..e27d97daad 100644
--- a/frappe/geo/doctype/address_template/address_template.json
+++ b/frappe/contacts/doctype/address_template/address_template.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 1,
"autoname": "field:country",
@@ -23,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Country",
@@ -52,6 +54,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Is Default",
@@ -81,6 +84,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Template",
@@ -98,20 +102,20 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-map-marker",
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-01-13 05:11:37.499528",
+ "modified": "2017-04-10 13:09:53.761009",
"modified_by": "Administrator",
- "module": "Geo",
+ "module": "Contacts",
"name": "Address Template",
"name_case": "",
"owner": "Administrator",
@@ -126,7 +130,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -141,6 +144,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
+ "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
diff --git a/frappe/geo/doctype/address_template/address_template.py b/frappe/contacts/doctype/address_template/address_template.py
similarity index 100%
rename from frappe/geo/doctype/address_template/address_template.py
rename to frappe/contacts/doctype/address_template/address_template.py
diff --git a/frappe/contacts/doctype/address_template/test_address_template.py b/frappe/contacts/doctype/address_template/test_address_template.py
new file mode 100644
index 0000000000..f40b56e7d9
--- /dev/null
+++ b/frappe/contacts/doctype/address_template/test_address_template.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe, unittest
+
+class TestAddressTemplate(unittest.TestCase):
+ def setUp(self):
+ self.make_default_address_template()
+
+ def test_default_is_unset(self):
+ a = frappe.get_doc("Address Template", "India")
+ a.is_default = 1
+ a.save()
+
+ b = frappe.get_doc("Address Template", "Brazil")
+ b.is_default = 1
+ b.save()
+
+ self.assertEqual(frappe.db.get_value("Address Template", "India", "is_default"), 0)
+
+ def tearDown(self):
+ a = frappe.get_doc("Address Template", "India")
+ a.is_default = 1
+ a.save()
+
+ @classmethod
+ def make_default_address_template(self):
+ template = """{{ address_line1 }}
{% if address_line2 %}{{ address_line2 }}
{% endif -%}{{ city }}
{% if state %}{{ state }}
{% endif -%}{% if pincode %}{{ pincode }}
{% endif -%}{{ country }}
{% if phone %}Phone: {{ phone }}
{% endif -%}{% if fax %}Fax: {{ fax }}
{% endif -%}{% if email_id %}Email: {{ email_id }}
{% endif -%}"""
+
+ if not frappe.db.exists('Address Template', 'India'):
+ frappe.get_doc({
+ "doctype": "Address Template",
+ "country": 'India',
+ "is_default": 1,
+ "template": template
+ }).insert()
+
+ if not frappe.db.exists('Address Template', 'Brazil'):
+ frappe.get_doc({
+ "doctype": "Address Template",
+ "country": 'Brazil',
+ "template": template
+ }).insert()
\ No newline at end of file
diff --git a/frappe/contacts/doctype/contact/__init__.py b/frappe/contacts/doctype/contact/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frappe/email/doctype/contact/contact.js b/frappe/contacts/doctype/contact/contact.js
similarity index 95%
rename from frappe/email/doctype/contact/contact.js
rename to frappe/contacts/doctype/contact/contact.js
index 901785a9b7..cfecddffb6 100644
--- a/frappe/email/doctype/contact/contact.js
+++ b/frappe/contacts/doctype/contact/contact.js
@@ -31,7 +31,7 @@ frappe.ui.form.on("Contact", {
}
frm.set_query('link_doctype', "links", function() {
return {
- query: "frappe.geo.address_and_contact.filter_dynamic_link_doctypes",
+ query: "frappe.contacts.address_and_contact.filter_dynamic_link_doctypes",
filters: {
fieldtype: "HTML",
fieldname: "contact_html",
diff --git a/frappe/email/doctype/contact/contact.json b/frappe/contacts/doctype/contact/contact.json
similarity index 91%
rename from frappe/email/doctype/contact/contact.json
rename to frappe/contacts/doctype/contact/contact.json
index a7f7bc873a..a9948e00d9 100644
--- a/frappe/email/doctype/contact/contact.json
+++ b/frappe/contacts/doctype/contact/contact.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"beta": 0,
@@ -40,6 +41,36 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "salutation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Salutation",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Salutation",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -218,6 +249,36 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "gender",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Gender",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Gender",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 1,
@@ -542,6 +603,7 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-user",
@@ -549,15 +611,15 @@
"image_field": "image",
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-02-20 14:54:33.723052",
+ "modified": "2017-04-10 13:09:27.880530",
"modified_by": "Administrator",
- "module": "Email",
+ "module": "Contacts",
"name": "Contact",
+ "name_case": "Title Case",
"owner": "Administrator",
"permissions": [
{
diff --git a/frappe/email/doctype/contact/contact.py b/frappe/contacts/doctype/contact/contact.py
similarity index 100%
rename from frappe/email/doctype/contact/contact.py
rename to frappe/contacts/doctype/contact/contact.py
diff --git a/frappe/email/doctype/contact/test_contact.py b/frappe/contacts/doctype/contact/test_contact.py
similarity index 77%
rename from frappe/email/doctype/contact/test_contact.py
rename to frappe/contacts/doctype/contact/test_contact.py
index 99b6581a73..496ff68299 100644
--- a/frappe/email/doctype/contact/test_contact.py
+++ b/frappe/contacts/doctype/contact/test_contact.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and Contributors
+# Copyright (c) 2017, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
diff --git a/frappe/email/doctype/contact/test_records.json b/frappe/contacts/doctype/contact/test_records.json
similarity index 100%
rename from frappe/email/doctype/contact/test_records.json
rename to frappe/contacts/doctype/contact/test_records.json
diff --git a/frappe/contacts/doctype/gender/__init__.py b/frappe/contacts/doctype/gender/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frappe/contacts/doctype/gender/gender.js b/frappe/contacts/doctype/gender/gender.js
new file mode 100644
index 0000000000..e2fd2f18eb
--- /dev/null
+++ b/frappe/contacts/doctype/gender/gender.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, Frappe Technologies and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Gender', {
+ refresh: function() {
+
+ }
+});
diff --git a/frappe/contacts/doctype/gender/gender.json b/frappe/contacts/doctype/gender/gender.json
new file mode 100644
index 0000000000..86a066cf0f
--- /dev/null
+++ b/frappe/contacts/doctype/gender/gender.json
@@ -0,0 +1,113 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:gender",
+ "beta": 0,
+ "creation": "2017-04-10 12:11:36.526508",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "gender",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Gender",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-04-10 12:17:04.848338",
+ "modified_by": "Administrator",
+ "module": "Contacts",
+ "name": "Gender",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "All",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/frappe/contacts/doctype/gender/gender.py b/frappe/contacts/doctype/gender/gender.py
new file mode 100644
index 0000000000..bfca5830c1
--- /dev/null
+++ b/frappe/contacts/doctype/gender/gender.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class Gender(Document):
+ pass
diff --git a/frappe/contacts/doctype/gender/test_gender.py b/frappe/contacts/doctype/gender/test_gender.py
new file mode 100644
index 0000000000..fbe3473bc3
--- /dev/null
+++ b/frappe/contacts/doctype/gender/test_gender.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestGender(unittest.TestCase):
+ pass
diff --git a/frappe/contacts/doctype/salutation/__init__.py b/frappe/contacts/doctype/salutation/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frappe/contacts/doctype/salutation/salutation.js b/frappe/contacts/doctype/salutation/salutation.js
new file mode 100644
index 0000000000..856b72e04c
--- /dev/null
+++ b/frappe/contacts/doctype/salutation/salutation.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, Frappe Technologies and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Salutation', {
+ refresh: function() {
+
+ }
+});
diff --git a/frappe/contacts/doctype/salutation/salutation.json b/frappe/contacts/doctype/salutation/salutation.json
new file mode 100644
index 0000000000..b60a592eea
--- /dev/null
+++ b/frappe/contacts/doctype/salutation/salutation.json
@@ -0,0 +1,132 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:salutation",
+ "beta": 0,
+ "creation": "2017-04-10 12:17:58.071915",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "salutation",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Salutation",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-04-10 12:55:18.855578",
+ "modified_by": "Administrator",
+ "module": "Contacts",
+ "name": "Salutation",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "All",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Administrator",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/frappe/contacts/doctype/salutation/salutation.py b/frappe/contacts/doctype/salutation/salutation.py
new file mode 100644
index 0000000000..d9e4528c7d
--- /dev/null
+++ b/frappe/contacts/doctype/salutation/salutation.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class Salutation(Document):
+ pass
diff --git a/frappe/contacts/doctype/salutation/test_salutation.py b/frappe/contacts/doctype/salutation/test_salutation.py
new file mode 100644
index 0000000000..63d603e6a4
--- /dev/null
+++ b/frappe/contacts/doctype/salutation/test_salutation.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSalutation(unittest.TestCase):
+ pass
diff --git a/frappe/contacts/report/__init__.py b/frappe/contacts/report/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frappe/contacts/report/addresses_and_contacts/__init__.py b/frappe/contacts/report/addresses_and_contacts/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/frappe/geo/report/addresses_and_contacts/addresses_and_contacts.js b/frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.js
similarity index 100%
rename from frappe/geo/report/addresses_and_contacts/addresses_and_contacts.js
rename to frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.js
diff --git a/frappe/geo/report/addresses_and_contacts/addresses_and_contacts.json b/frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.json
similarity index 88%
rename from frappe/geo/report/addresses_and_contacts/addresses_and_contacts.json
rename to frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.json
index f21db17886..2d62444639 100644
--- a/frappe/geo/report/addresses_and_contacts/addresses_and_contacts.json
+++ b/frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.json
@@ -7,9 +7,9 @@
"doctype": "Report",
"idx": 2,
"is_standard": "Yes",
- "modified": "2017-02-24 19:57:37.368498",
+ "modified": "2017-04-10 15:04:12.498920",
"modified_by": "Administrator",
- "module": "Geo",
+ "module": "Contacts",
"name": "Addresses And Contacts",
"owner": "Administrator",
"ref_doctype": "Address",
diff --git a/frappe/geo/report/addresses_and_contacts/addresses_and_contacts.py b/frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.py
similarity index 100%
rename from frappe/geo/report/addresses_and_contacts/addresses_and_contacts.py
rename to frappe/contacts/report/addresses_and_contacts/addresses_and_contacts.py
diff --git a/frappe/desk/page/setup_wizard/install_fixtures.py b/frappe/desk/page/setup_wizard/install_fixtures.py
new file mode 100644
index 0000000000..7e67907a3b
--- /dev/null
+++ b/frappe/desk/page/setup_wizard/install_fixtures.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+
+from frappe import _
+
+def install():
+ update_genders_and_salutations()
+
+@frappe.whitelist()
+def update_genders_and_salutations():
+ default_genders = [_("Male"), _("Female"), _("Other")]
+ default_salutations = [_("Mr"), _("Ms"), _('Mx'), _("Dr"), _("Mrs"), _("Madam"), _("Miss"), _("Master"), _("Prof")]
+ records = [{'doctype': 'Gender', 'gender': d} for d in default_genders]
+ records += [{'doctype': 'Salutation', 'salutation': d} for d in default_salutations]
+ for record in records:
+ doc = frappe.new_doc(record.get("doctype"))
+ doc.update(record)
+
+ try:
+ doc.insert(ignore_permissions=True)
+ except frappe.DuplicateEntryError, e:
+ # pass DuplicateEntryError and continue
+ if e.args and e.args[0]==doc.doctype and e.args[1]==doc.name:
+ # make sure DuplicateEntryError is for the exact same doc and not a related doc
+ pass
+ else:
+ raise
\ No newline at end of file
diff --git a/frappe/desk/page/setup_wizard/setup_wizard.py b/frappe/desk/page/setup_wizard/setup_wizard.py
index 351c62a45c..dcc9e2bcd8 100755
--- a/frappe/desk/page/setup_wizard/setup_wizard.py
+++ b/frappe/desk/page/setup_wizard/setup_wizard.py
@@ -10,6 +10,7 @@ from frappe.geo.country_info import get_country_info
from frappe.utils.file_manager import save_file
from frappe.utils.password import update_password
from werkzeug.useragents import UserAgent
+import install_fixtures
@frappe.whitelist()
def setup_complete(args):
@@ -53,6 +54,7 @@ def setup_complete(args):
else:
for hook in frappe.get_hooks("setup_wizard_success"):
frappe.get_attr(hook)(args)
+ install_fixtures.install()
def update_system_settings(args):
diff --git a/frappe/geo/doctype/address/test_address.py b/frappe/geo/doctype/address/test_address.py
deleted file mode 100644
index 2c067799f9..0000000000
--- a/frappe/geo/doctype/address/test_address.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe, unittest
-test_records = frappe.get_test_records('Address')
-
-from frappe.geo.doctype.address.address import get_address_display
-
-class TestAddress(unittest.TestCase):
- def test_template_works(self):
- address = frappe.get_list("Address")[0].name
- display = get_address_display(frappe.get_doc("Address", address).as_dict())
- self.assertTrue(display)
-
-
-test_dependencies = ["Address Template"]
diff --git a/frappe/geo/doctype/address/test_records.json b/frappe/geo/doctype/address/test_records.json
deleted file mode 100644
index 1c418f7bef..0000000000
--- a/frappe/geo/doctype/address/test_records.json
+++ /dev/null
@@ -1,13 +0,0 @@
-[
- {
- "address_line1": "_Test Address Line 1",
- "address_title": "_Test Address",
- "address_type": "Office",
- "city": "_Test City",
- "state": "Test State",
- "country": "India",
- "doctype": "Address",
- "is_primary_address": 1,
- "phone": "+91 0000000000"
- }
-]
\ No newline at end of file
diff --git a/frappe/geo/doctype/address_template/test_address_template.py b/frappe/geo/doctype/address_template/test_address_template.py
deleted file mode 100644
index 8e300ac457..0000000000
--- a/frappe/geo/doctype/address_template/test_address_template.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe, unittest
-test_records = frappe.get_test_records('Address Template')
-
-class TestAddressTemplate(unittest.TestCase):
- def test_default_is_unset(self):
- a = frappe.get_doc("Address Template", "India")
- a.is_default = 1
- a.save()
-
- b = frappe.get_doc("Address Template", "Brazil")
- b.is_default = 1
- b.save()
-
- self.assertEqual(frappe.db.get_value("Address Template", "India", "is_default"), 0)
-
- def tearDown(self):
- a = frappe.get_doc("Address Template", "India")
- a.is_default = 1
- a.save()
diff --git a/frappe/geo/doctype/address_template/test_records.json b/frappe/geo/doctype/address_template/test_records.json
deleted file mode 100644
index 412c9e745b..0000000000
--- a/frappe/geo/doctype/address_template/test_records.json
+++ /dev/null
@@ -1,13 +0,0 @@
-[
- {
- "country": "India",
- "is_default": 1,
- "template": "{{ address_title }}
\n{{ address_line1 }}
\n{% if address_line2 %}{{ address_line2 }}
{% endif %}\n{{ city }}
\n{% if state %}{{ state }}
{% endif %}\n{% if pincode %} PIN / ZIP: {{ pincode }}
{% endif %}\n{{ country }}
\n{% if phone %}Phone: {{ phone }}
{% endif %}\n{% if fax %}Fax: {{ fax }}
{% endif %}\n{% if email_id %}Email: {{ email_id }}
{% endif %}\n"
- },
- {
- "country": "Brazil",
- "is_default": 0,
- "template": "{{ address_title }}
\n{{ address_line1 }}
\n{% if address_line2 %}{{ address_line2 }}
{% endif %}\n{{ city }}
\n{% if state %}{{ state }}
{% endif %}\n{% if pincode %} PIN / ZIP: {{ pincode }}
{% endif %}\n{{ country }}
\n{% if phone %}Phone: {{ phone }}
{% endif %}\n{% if fax %}Fax: {{ fax }}
{% endif %}\n{% if email_id %}Email: {{ email_id }}
{% endif %}\n"
- }
-]
-
diff --git a/frappe/hooks.py b/frappe/hooks.py
index e1618b89d0..104dabe814 100755
--- a/frappe/hooks.py
+++ b/frappe/hooks.py
@@ -79,8 +79,8 @@ permission_query_conditions = {
"User": "frappe.core.doctype.user.user.get_permission_query_conditions",
"Note": "frappe.desk.doctype.note.note.get_permission_query_conditions",
"Kanban Board": "frappe.desk.doctype.kanban_board.kanban_board.get_permission_query_conditions",
- "Contact": "frappe.geo.address_and_contact.get_permission_query_conditions_for_contact",
- "Address": "frappe.geo.address_and_contact.get_permission_query_conditions_for_address",
+ "Contact": "frappe.contacts.address_and_contact.get_permission_query_conditions_for_contact",
+ "Address": "frappe.contacts.address_and_contact.get_permission_query_conditions_for_address",
"Communication": "frappe.core.doctype.communication.communication.get_permission_query_conditions_for_communication"
}
@@ -90,8 +90,8 @@ has_permission = {
"User": "frappe.core.doctype.user.user.has_permission",
"Note": "frappe.desk.doctype.note.note.has_permission",
"Kanban Board": "frappe.desk.doctype.kanban_board.kanban_board.has_permission",
- "Contact": "frappe.geo.address_and_contact.has_permission",
- "Address": "frappe.geo.address_and_contact.has_permission",
+ "Contact": "frappe.contacts.address_and_contact.has_permission",
+ "Address": "frappe.contacts.address_and_contact.has_permission",
"Communication": "frappe.core.doctype.communication.communication.has_permission",
}
diff --git a/frappe/modules.txt b/frappe/modules.txt
index 95b9c8fed5..0d2e91b35f 100644
--- a/frappe/modules.txt
+++ b/frappe/modules.txt
@@ -6,4 +6,5 @@ Custom
Geo
Desk
Integrations
-Printing
\ No newline at end of file
+Printing
+Contacts
diff --git a/frappe/patches.txt b/frappe/patches.txt
index ad04e56367..9fb0206557 100644
--- a/frappe/patches.txt
+++ b/frappe/patches.txt
@@ -182,4 +182,5 @@ frappe.patches.v8_0.install_new_build_system_requirements
frappe.patches.v8_0.set_currency_field_precision # 2017-05-09
frappe.patches.v8_0.rename_print_to_printing
frappe.patches.v7_1.disabled_print_settings_for_custom_print_format
-frappe.patches.v8_0.update_desktop_icons
\ No newline at end of file
+frappe.patches.v8_0.update_desktop_icons
+frappe.patches.v8_0.update_gender_and_salutation
\ No newline at end of file
diff --git a/frappe/patches/v8_0/update_gender_and_salutation.py b/frappe/patches/v8_0/update_gender_and_salutation.py
new file mode 100644
index 0000000000..6276dc12b8
--- /dev/null
+++ b/frappe/patches/v8_0/update_gender_and_salutation.py
@@ -0,0 +1,11 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+
+from __future__ import unicode_literals
+import frappe
+from frappe.desk.page.setup_wizard.install_fixtures import update_genders_and_salutations
+
+def execute():
+ frappe.db.set_value("DocType", "Contact", "module", "Contacts")
+ frappe.db.set_value("DocType", "Address", "module", "Contacts")
+ frappe.db.set_value("DocType", "Address Template", "module", "Contacts")
+ update_genders_and_salutations()
\ No newline at end of file
diff --git a/frappe/public/js/frappe/misc/address_and_contact.js b/frappe/public/js/frappe/misc/address_and_contact.js
index 14a2195f23..73e1ff0fb7 100644
--- a/frappe/public/js/frappe/misc/address_and_contact.js
+++ b/frappe/public/js/frappe/misc/address_and_contact.js
@@ -1,6 +1,6 @@
-frappe.provide('frappe.geo')
+frappe.provide('frappe.contacts')
-$.extend(frappe.geo, {
+$.extend(frappe.contacts, {
clear_address_and_contact: function(frm) {
$(frm.fields_dict['address_html'].wrapper).html("");
frm.fields_dict['contact_html'] && $(frm.fields_dict['contact_html'].wrapper).html("");