[minor] [enhancement] added frappe.get_precision
This commit is contained in:
parent
8a64ef9ef3
commit
b82da2a897
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue