Ver a proveniência

[minor] [enhancement] added frappe.get_precision

version-14
Rushabh Mehta há 10 anos
ascendente
cometimento
b82da2a897
1 ficheiros alterados com 5 adições e 0 eliminações
  1. +5
    -0
      frappe/__init__.py

+ 5
- 0
frappe/__init__.py Ver ficheiro

@@ -424,6 +424,11 @@ def is_table(doctype):
cache().set_value("is_table", tables)
return doctype in tables

def get_precision(doctype, fieldname, currency=None, doc=None):
"""Get precision for a given field"""
from frappe.model.meta import get_field_precision
return get_field_precision(get_meta(doctype).get_field(fieldname), doc, currency)

def generate_hash(txt=None):
"""Generates random hash for given text + current timestamp + random string."""
import hashlib, time


Carregando…
Cancelar
Guardar