Pārlūkot izejas kodu

Minor fix in Google maps

version-14
Nabin Hait pirms 7 gadiem
vecāks
revīzija
1ae64870be
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. +8
    -2
      frappe/integrations/doctype/google_maps/google_maps.py

+ 8
- 2
frappe/integrations/doctype/google_maps/google_maps.py Parādīt failu

@@ -4,11 +4,17 @@


from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
import datetime import datetime


class GoogleMaps(Document): class GoogleMaps(Document):
pass
def validate(self):
if self.enabled:
if not self.client_key:
frappe.throw(_("Client key is required"))
if not self.home_address:
frappe.throw(_("Home Address is required"))


def round_timedelta(td, period): def round_timedelta(td, period):
"""Round timedelta""" """Round timedelta"""
@@ -20,7 +26,7 @@ def round_timedelta(td, period):
else: else:
return datetime.timedelta(seconds=td.total_seconds() - remainder) return datetime.timedelta(seconds=td.total_seconds() - remainder)


def customer_address_format(address):
def format_address(address):
"""Customer Address format """ """Customer Address format """
address = frappe.get_doc('Address', address) address = frappe.get_doc('Address', address)
return '{}, {}, {}, {}'.format(address.address_line1, address.city, address.pincode, address.country) return '{}, {}, {}, {}'.format(address.address_line1, address.city, address.pincode, address.country)

Notiek ielāde…
Atcelt
Saglabāt