feat: move gmaps to erpnext

This commit is contained in:
Himanshu Warekar 2019-07-10 11:21:17 +05:30
parent 0e676dfb86
commit 3074af50f0
6 changed files with 0 additions and 119 deletions

View file

@ -92,11 +92,6 @@ def get_data():
"name": "Google Settings",
"description": _("Google API Settings."),
},
{
"type": "doctype",
"name": "Google Maps",
"description": _("Google Maps Integration"),
},
{
"type": "doctype",
"name": "GCalendar Settings",

View file

@ -1,8 +0,0 @@
// Copyright (c) 2019, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on('Google Maps', {
// refresh: function(frm) {
// }
});

View file

@ -1,65 +0,0 @@
{
"autoname": "format:Maps-{entity}",
"creation": "2019-06-29 13:03:45.935466",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"enable",
"sb_00",
"driver",
"cb_00",
"address"
],
"fields": [
{
"fieldname": "address",
"fieldtype": "Link",
"label": "Address",
"options": "Address"
},
{
"fieldname": "cb_00",
"fieldtype": "Column Break"
},
{
"depends_on": "eval: doc.enable",
"fieldname": "sb_00",
"fieldtype": "Section Break",
"label": "Google Maps"
},
{
"default": "0",
"description": "Uses Google Maps Directions API to optimize routes.",
"fieldname": "enable",
"fieldtype": "Check",
"label": "Enable"
},
{
"fieldname": "driver",
"fieldtype": "Link",
"label": "Driver",
"options": "Driver"
}
],
"modified": "2019-07-08 20:20:12.885960",
"modified_by": "Administrator",
"module": "Integrations",
"name": "Google Maps",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View file

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class GoogleMaps(Document):
def validate(self):
if self.enable:
if not frappe.db.get_single_value("Google Settings", "enable"):
frappe.throw(_("Enable Google Settings for Google Maps Integration."))
if not frappe.db.get_single_value("Google Settings", "api_key"):
frappe.throw(_("Enter API Key for Google Maps Integration in Google Settings."))
def get_client(self):
if not self.enable:
frappe.throw(_("Google Maps Integration is not enabled."))
import googlemaps
try:
client = googlemaps.Client(key=frappe.db.get_single_value("Google Settings", "api_key"))
except Exception as e:
frappe.throw(e.message)
return client

View file

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestGoogleMaps(unittest.TestCase):
pass