[webshop] territories in price list, taxes, updates in shopping cart settings

This commit is contained in:
Anand Doshi
2013-06-21 17:55:31 +05:30
parent d52b03a8cc
commit 61a2f68bc6
33 changed files with 462 additions and 137 deletions

View File

@@ -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):
"""