mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
[webshop] territories in price list, taxes, updates in shopping cart settings
This commit is contained in:
@@ -29,6 +29,19 @@ def get_company_currency(company):
|
||||
|
||||
return currency
|
||||
|
||||
def get_root_of(doctype):
|
||||
"""Get root element of a DocType with a tree structure"""
|
||||
result = webnotes.conn.sql_list("""select name from `tab%s`
|
||||
where lft=1 and rgt=(select max(rgt) from `tab%s`)""" % (doctype, doctype))
|
||||
return result[0] if result else None
|
||||
|
||||
def get_ancestors_of(doctype, name):
|
||||
"""Get ancestor elements of a DocType with a tree structure"""
|
||||
lft, rgt = webnotes.conn.get_value(doctype, name, ["lft", "rgt"])
|
||||
result = webnotes.conn.sql_list("""select name from `tab%s`
|
||||
where lft<%s and rgt>%s""" % (doctype, "%s", "%s"), (lft, rgt))
|
||||
return result or None
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_price_list_currency(args):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user