Merge branch 'master' into edge
This commit is contained in:
commit
5ea0133f97
@ -3,17 +3,19 @@ def make_test_records(verbose):
|
|||||||
|
|
||||||
accounts = [
|
accounts = [
|
||||||
# [account_name, parent_account, group_or_ledger]
|
# [account_name, parent_account, group_or_ledger]
|
||||||
|
["_Test Account Bank Account", "Bank Accounts - _TC", "Ledger"],
|
||||||
["_Test Account Stock Expenses", "Direct Expenses - _TC", "Group"],
|
["_Test Account Stock Expenses", "Direct Expenses - _TC", "Group"],
|
||||||
["_Test Account Shipping Charges", "_Test Account Stock Expenses - _TC", "Ledger"],
|
["_Test Account Shipping Charges", "_Test Account Stock Expenses - _TC", "Ledger"],
|
||||||
["_Test Account Customs Duty", "_Test Account Stock Expenses - _TC", "Ledger"],
|
["_Test Account Customs Duty", "_Test Account Stock Expenses - _TC", "Ledger"],
|
||||||
["_Test Account Tax Assets", "Current Assets - _TC", "Group"],
|
["_Test Account Tax Assets", "Current Assets - _TC", "Group"],
|
||||||
["_Test Account VAT", "_Test Account Tax Assets - _TC", "Ledger"],
|
["_Test Account VAT", "_Test Account Tax Assets - _TC", "Ledger"],
|
||||||
|
["_Test Account Service Tax", "_Test Account Tax Assets - _TC", "Ledger"],
|
||||||
["_Test Account Cost for Goods Sold", "Expenses - _TC", "Ledger"],
|
["_Test Account Cost for Goods Sold", "Expenses - _TC", "Ledger"],
|
||||||
["_Test Account Excise Duty", "_Test Account Tax Assets - _TC", "Ledger"],
|
["_Test Account Excise Duty", "_Test Account Tax Assets - _TC", "Ledger"],
|
||||||
["_Test Account Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
|
["_Test Account Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
|
||||||
["_Test Account S&H Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
|
["_Test Account S&H Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
|
||||||
["_Test Account CST", "Direct Expenses - _TC", "Ledger"],
|
["_Test Account CST", "Direct Expenses - _TC", "Ledger"],
|
||||||
["_Test Account Discount", "Direct Expenses - _TC", "Ledger"]
|
["_Test Account Discount", "Direct Expenses - _TC", "Ledger"],
|
||||||
]
|
]
|
||||||
|
|
||||||
return make_test_objects("Account", [[{
|
return make_test_objects("Account", [[{
|
||||||
|
@ -18,110 +18,147 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import unittest
|
import unittest
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.model
|
|
||||||
from webnotes.utils import nowdate, flt, add_days
|
|
||||||
from accounts.utils import get_fiscal_year, get_balance_on
|
|
||||||
|
|
||||||
company = webnotes.conn.get_default("company")
|
test_records = [[
|
||||||
abbr = webnotes.conn.get_value("Company", company, "abbr")
|
{
|
||||||
|
"company": "_Test Company",
|
||||||
data = {
|
"doctype": "Journal Voucher",
|
||||||
"expense_account": {
|
"fiscal_year": "_Test Fiscal Year 2013",
|
||||||
"doctype": "Account",
|
"naming_series": "_T-Journal Voucher-",
|
||||||
"account_name": "Test Expense",
|
"posting_date": "2013-02-14",
|
||||||
"parent_account": "Direct Expenses - %s" % abbr,
|
"tds_applicable": "No",
|
||||||
"company": company,
|
"user_remark": "test",
|
||||||
"debit_or_credit": "Debit",
|
"voucher_type": "Bank Voucher",
|
||||||
"is_pl_account": "Yes",
|
"cheque_no": "33",
|
||||||
"group_or_ledger": "Ledger"
|
"cheque_date": "2013-02-14"
|
||||||
},
|
},
|
||||||
"supplier_account": {
|
{
|
||||||
"doctype": "Account",
|
"account": "_Test Customer - _TC",
|
||||||
"account_name": "Test Supplier",
|
"doctype": "Journal Voucher Detail",
|
||||||
"parent_account": "Accounts Payable - %s" % abbr,
|
"credit": 400.0,
|
||||||
"company": company,
|
"debit": 0.0,
|
||||||
"debit_or_credit": "Credit",
|
"parentfield": "entries"
|
||||||
"is_pl_account": "No",
|
|
||||||
"group_or_ledger": "Ledger"
|
|
||||||
},
|
},
|
||||||
"test_cost_center": {
|
{
|
||||||
"doctype": "Cost Center",
|
"account": "_Test Account Bank Account - _TC",
|
||||||
"cost_center_name": "Test Cost Center",
|
"doctype": "Journal Voucher Detail",
|
||||||
"parent_cost_center": "Root - %s" % abbr,
|
"debit": 400.0,
|
||||||
"company_name": company,
|
"credit": 0.0,
|
||||||
"group_or_ledger": "Ledger",
|
"parentfield": "entries"
|
||||||
"company_abbr": abbr
|
}
|
||||||
},
|
]]
|
||||||
"journal_voucher": [
|
|
||||||
{
|
|
||||||
"doctype": "Journal Voucher",
|
|
||||||
"voucher_type": "Journal Entry",
|
|
||||||
"naming_series": "JV",
|
|
||||||
"posting_date": nowdate(),
|
|
||||||
"remark": "Test Journal Voucher",
|
|
||||||
"fiscal_year": get_fiscal_year(nowdate())[0],
|
|
||||||
"company": company
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"doctype": "Journal Voucher Detail",
|
|
||||||
"parentfield": "entries",
|
|
||||||
"account": "Test Expense - %s" % abbr,
|
|
||||||
"debit": 5000,
|
|
||||||
"cost_center": "Test Cost Center - %s" % abbr,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"doctype": "Journal Voucher Detail",
|
|
||||||
"parentfield": "entries",
|
|
||||||
"account": "Test Supplier - %s" % abbr,
|
|
||||||
"credit": 5000,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
def get_name(s):
|
|
||||||
return s + " - " + abbr
|
|
||||||
|
|
||||||
class TestJournalVoucher(unittest.TestCase):
|
|
||||||
def setUp(self):
|
|
||||||
webnotes.conn.begin()
|
|
||||||
|
|
||||||
# create a dummy account
|
|
||||||
webnotes.model.insert([data["expense_account"]])
|
|
||||||
webnotes.model.insert([data["supplier_account"]])
|
|
||||||
webnotes.model.insert([data["test_cost_center"]])
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
webnotes.conn.rollback()
|
|
||||||
|
|
||||||
def test_save_journal_voucher(self):
|
|
||||||
expense_ac_balance = get_balance_on(get_name("Test Expense"), nowdate())
|
|
||||||
supplier_ac_balance = get_balance_on(get_name("Test Supplier"), nowdate())
|
|
||||||
|
|
||||||
dl = webnotes.model.insert(data["journal_voucher"])
|
#
|
||||||
dl.submit()
|
#
|
||||||
dl.load_from_db()
|
# import webnotes.model
|
||||||
|
# from webnotes.utils import nowdate, flt, add_days
|
||||||
# test submitted jv
|
# from accounts.utils import get_fiscal_year, get_balance_on
|
||||||
self.assertTrue(webnotes.conn.exists("Journal Voucher", dl.doclist[0].name))
|
#
|
||||||
for d in dl.doclist[1:]:
|
# company = webnotes.conn.get_default("company")
|
||||||
self.assertEquals(webnotes.conn.get_value("Journal Voucher Detail",
|
# abbr = webnotes.conn.get_value("Company", company, "abbr")
|
||||||
d.name, "parent"), dl.doclist[0].name)
|
#
|
||||||
|
# data = {
|
||||||
# test gl entry
|
# "expense_account": {
|
||||||
gle = webnotes.conn.sql("""select account, debit, credit
|
# "doctype": "Account",
|
||||||
from `tabGL Entry` where voucher_no = %s order by account""",
|
# "account_name": "Test Expense",
|
||||||
dl.doclist[0].name)
|
# "parent_account": "Direct Expenses - %s" % abbr,
|
||||||
|
# "company": company,
|
||||||
self.assertEquals((gle[0][0], flt(gle[0][1]), flt(gle[0][2])),
|
# "debit_or_credit": "Debit",
|
||||||
('Test Expense - %s' % abbr, 5000.0, 0.0))
|
# "is_pl_account": "Yes",
|
||||||
self.assertEquals((gle[1][0], flt(gle[1][1]), flt(gle[1][2])),
|
# "group_or_ledger": "Ledger"
|
||||||
('Test Supplier - %s' % abbr, 0.0, 5000.0))
|
# },
|
||||||
|
# "supplier_account": {
|
||||||
# check balance as on today
|
# "doctype": "Account",
|
||||||
self.assertEqual(get_balance_on(get_name("Test Expense"), nowdate()),
|
# "account_name": "Test Supplier",
|
||||||
expense_ac_balance + 5000)
|
# "parent_account": "Accounts Payable - %s" % abbr,
|
||||||
self.assertEqual(get_balance_on(get_name("Test Supplier"), nowdate()),
|
# "company": company,
|
||||||
supplier_ac_balance + 5000)
|
# "debit_or_credit": "Credit",
|
||||||
|
# "is_pl_account": "No",
|
||||||
# check previous balance
|
# "group_or_ledger": "Ledger"
|
||||||
self.assertEqual(get_balance_on(get_name("Test Expense"), add_days(nowdate(), -1)), 0)
|
# },
|
||||||
|
# "test_cost_center": {
|
||||||
|
# "doctype": "Cost Center",
|
||||||
|
# "cost_center_name": "Test Cost Center",
|
||||||
|
# "parent_cost_center": "Root - %s" % abbr,
|
||||||
|
# "company_name": company,
|
||||||
|
# "group_or_ledger": "Ledger",
|
||||||
|
# "company_abbr": abbr
|
||||||
|
# },
|
||||||
|
# "journal_voucher": [
|
||||||
|
# {
|
||||||
|
# "doctype": "Journal Voucher",
|
||||||
|
# "voucher_type": "Journal Entry",
|
||||||
|
# "naming_series": "JV",
|
||||||
|
# "posting_date": nowdate(),
|
||||||
|
# "remark": "Test Journal Voucher",
|
||||||
|
# "fiscal_year": get_fiscal_year(nowdate())[0],
|
||||||
|
# "company": company
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "doctype": "Journal Voucher Detail",
|
||||||
|
# "parentfield": "entries",
|
||||||
|
# "account": "Test Expense - %s" % abbr,
|
||||||
|
# "debit": 5000,
|
||||||
|
# "cost_center": "Test Cost Center - %s" % abbr,
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "doctype": "Journal Voucher Detail",
|
||||||
|
# "parentfield": "entries",
|
||||||
|
# "account": "Test Supplier - %s" % abbr,
|
||||||
|
# "credit": 5000,
|
||||||
|
# },
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# def get_name(s):
|
||||||
|
# return s + " - " + abbr
|
||||||
|
#
|
||||||
|
# class TestJournalVoucher(unittest.TestCase):
|
||||||
|
# def setUp(self):
|
||||||
|
# webnotes.conn.begin()
|
||||||
|
#
|
||||||
|
# # create a dummy account
|
||||||
|
# webnotes.model.insert([data["expense_account"]])
|
||||||
|
# webnotes.model.insert([data["supplier_account"]])
|
||||||
|
# webnotes.model.insert([data["test_cost_center"]])
|
||||||
|
#
|
||||||
|
# def tearDown(self):
|
||||||
|
# webnotes.conn.rollback()
|
||||||
|
#
|
||||||
|
# def test_save_journal_voucher(self):
|
||||||
|
# expense_ac_balance = get_balance_on(get_name("Test Expense"), nowdate())
|
||||||
|
# supplier_ac_balance = get_balance_on(get_name("Test Supplier"), nowdate())
|
||||||
|
#
|
||||||
|
# dl = webnotes.model.insert(data["journal_voucher"])
|
||||||
|
# dl.submit()
|
||||||
|
# dl.load_from_db()
|
||||||
|
#
|
||||||
|
# # test submitted jv
|
||||||
|
# self.assertTrue(webnotes.conn.exists("Journal Voucher", dl.doclist[0].name))
|
||||||
|
# for d in dl.doclist[1:]:
|
||||||
|
# self.assertEquals(webnotes.conn.get_value("Journal Voucher Detail",
|
||||||
|
# d.name, "parent"), dl.doclist[0].name)
|
||||||
|
#
|
||||||
|
# # test gl entry
|
||||||
|
# gle = webnotes.conn.sql("""select account, debit, credit
|
||||||
|
# from `tabGL Entry` where voucher_no = %s order by account""",
|
||||||
|
# dl.doclist[0].name)
|
||||||
|
#
|
||||||
|
# self.assertEquals((gle[0][0], flt(gle[0][1]), flt(gle[0][2])),
|
||||||
|
# ('Test Expense - %s' % abbr, 5000.0, 0.0))
|
||||||
|
# self.assertEquals((gle[1][0], flt(gle[1][1]), flt(gle[1][2])),
|
||||||
|
# ('Test Supplier - %s' % abbr, 0.0, 5000.0))
|
||||||
|
#
|
||||||
|
# # check balance as on today
|
||||||
|
# self.assertEqual(get_balance_on(get_name("Test Expense"), nowdate()),
|
||||||
|
# expense_ac_balance + 5000)
|
||||||
|
# self.assertEqual(get_balance_on(get_name("Test Supplier"), nowdate()),
|
||||||
|
# supplier_ac_balance + 5000)
|
||||||
|
#
|
||||||
|
# # check previous balance
|
||||||
|
# self.assertEqual(get_balance_on(get_name("Test Expense"), add_days(nowdate(), -1)), 0)
|
84
accounts/doctype/sales_invoice/test_sales_invoice.py
Normal file
84
accounts/doctype/sales_invoice/test_sales_invoice.py
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import webnotes
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class TestSalesInvoice(unittest.TestCase):
|
||||||
|
def make(self):
|
||||||
|
w = webnotes.model_wrapper(webnotes.copy_doclist(test_records[0]))
|
||||||
|
w.insert()
|
||||||
|
w.submit()
|
||||||
|
return w
|
||||||
|
|
||||||
|
def test_outstanding(self):
|
||||||
|
w = self.make()
|
||||||
|
self.assertEquals(w.doc.outstanding_amount, w.doc.grand_total)
|
||||||
|
|
||||||
|
def test_payment(self):
|
||||||
|
w = self.make()
|
||||||
|
from accounts.doctype.journal_voucher.test_journal_voucher \
|
||||||
|
import test_records as jv_test_records
|
||||||
|
|
||||||
|
jv = webnotes.model_wrapper(webnotes.copy_doclist(jv_test_records[0]))
|
||||||
|
jv.doclist[1].against_invoice = w.doc.name
|
||||||
|
jv.insert()
|
||||||
|
jv.submit()
|
||||||
|
|
||||||
|
self.assertEquals(webnotes.conn.get_value("Sales Invoice", w.doc.name, "outstanding_amount"),
|
||||||
|
161.8)
|
||||||
|
|
||||||
|
jv.cancel()
|
||||||
|
self.assertEquals(webnotes.conn.get_value("Sales Invoice", w.doc.name, "outstanding_amount"),
|
||||||
|
561.8)
|
||||||
|
|
||||||
|
test_dependencies = ["Journal Voucher"]
|
||||||
|
|
||||||
|
test_records = [[
|
||||||
|
{
|
||||||
|
"naming_series": "_T-Sales Invoice-",
|
||||||
|
"company": "_Test Company",
|
||||||
|
"conversion_rate": 1.0,
|
||||||
|
"currency": "INR",
|
||||||
|
"debit_to": "_Test Customer - _TC",
|
||||||
|
"customer": "_Test Customer",
|
||||||
|
"customer_name": "_Test Customer",
|
||||||
|
"doctype": "Sales Invoice",
|
||||||
|
"due_date": "2013-01-23",
|
||||||
|
"fiscal_year": "_Test Fiscal Year 2013",
|
||||||
|
"grand_total": 561.8,
|
||||||
|
"grand_total_export": 561.8,
|
||||||
|
"net_total": 500.0,
|
||||||
|
"plc_conversion_rate": 1.0,
|
||||||
|
"posting_date": "2013-01-23",
|
||||||
|
"price_list_currency": "INR",
|
||||||
|
"price_list_name": "_Test Price List",
|
||||||
|
"territory": "_Test Territory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amount": 500.0,
|
||||||
|
"basic_rate": 500.0,
|
||||||
|
"description": "138-CMS Shoe",
|
||||||
|
"doctype": "Sales Invoice Item",
|
||||||
|
"export_amount": 500.0,
|
||||||
|
"export_rate": 500.0,
|
||||||
|
"income_account": "Sales - _TC",
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"item_name": "138-CMS Shoe",
|
||||||
|
"parentfield": "entries",
|
||||||
|
"qty": 1.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account_head": "_Test Account VAT - _TC",
|
||||||
|
"charge_type": "On Net Total",
|
||||||
|
"description": "VAT",
|
||||||
|
"doctype": "Sales Taxes and Charges",
|
||||||
|
"parentfield": "other_charges",
|
||||||
|
"tax_amount": 30.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account_head": "_Test Account Service Tax - _TC",
|
||||||
|
"charge_type": "On Net Total",
|
||||||
|
"description": "Service Tax",
|
||||||
|
"doctype": "Sales Taxes and Charges",
|
||||||
|
"parentfield": "other_charges",
|
||||||
|
"tax_amount": 31.8,
|
||||||
|
}
|
||||||
|
]]
|
@ -24,12 +24,12 @@ def make_gl_entries(gl_map, cancel=False, adv_adj=False, merge_entries=True,
|
|||||||
if merge_entries:
|
if merge_entries:
|
||||||
gl_map = merge_similar_entries(gl_map)
|
gl_map = merge_similar_entries(gl_map)
|
||||||
|
|
||||||
check_budget(gl_map, cancel)
|
|
||||||
save_entries(gl_map, cancel, adv_adj, update_outstanding)
|
|
||||||
|
|
||||||
if cancel:
|
if cancel:
|
||||||
set_as_cancel(gl_map[0]["voucher_type"], gl_map[0]["voucher_no"])
|
set_as_cancel(gl_map[0]["voucher_type"], gl_map[0]["voucher_no"])
|
||||||
|
|
||||||
|
check_budget(gl_map, cancel)
|
||||||
|
save_entries(gl_map, cancel, adv_adj, update_outstanding)
|
||||||
|
|
||||||
def merge_similar_entries(gl_map):
|
def merge_similar_entries(gl_map):
|
||||||
merged_gl_map = []
|
merged_gl_map = []
|
||||||
for entry in gl_map:
|
for entry in gl_map:
|
||||||
|
@ -12,4 +12,4 @@ def execute():
|
|||||||
if flt(r[1]) != abs(flt(outstanding[0][0])):
|
if flt(r[1]) != abs(flt(outstanding[0][0])):
|
||||||
# print r, outstanding
|
# print r, outstanding
|
||||||
webnotes.conn.sql("update `tab%s` set outstanding_amount = %s where name = %s" %
|
webnotes.conn.sql("update `tab%s` set outstanding_amount = %s where name = %s" %
|
||||||
(dt, '%s', '%s'), (abs(flt(outstanding[0][0])), si[0]))
|
(dt, '%s', '%s'), (abs(flt(outstanding[0][0])), r[0]))
|
@ -169,4 +169,5 @@ patch_list = [
|
|||||||
"patches.february_2013.update_company_in_leave_application",
|
"patches.february_2013.update_company_in_leave_application",
|
||||||
"execute:webnotes.conn.sql_ddl('alter table tabSeries change `name` `name` varchar(100)')",
|
"execute:webnotes.conn.sql_ddl('alter table tabSeries change `name` `name` varchar(100)')",
|
||||||
"execute:webnotes.conn.sql('update tabUserRole set parentfield=\"user_roles\" where parentfield=\"userroles\"')",
|
"execute:webnotes.conn.sql('update tabUserRole set parentfield=\"user_roles\" where parentfield=\"userroles\"')",
|
||||||
|
"patches.february_2013.fix_outstanding"
|
||||||
]
|
]
|
@ -734,13 +734,14 @@ class StatusUpdater:
|
|||||||
"""
|
"""
|
||||||
# get unique transactions to update
|
# get unique transactions to update
|
||||||
for d in self.obj.doclist:
|
for d in self.obj.doclist:
|
||||||
if d.doctype == args['source_dt']:
|
if d.doctype == args['source_dt'] and d.fields.get(args["join_field"]):
|
||||||
args['name'] = d.fields[args['join_field']]
|
args['name'] = d.fields[args['join_field']]
|
||||||
|
|
||||||
# get all qty where qty > compare_field
|
# get all qty where qty > compare_field
|
||||||
item = webnotes.conn.sql("""
|
item = webnotes.conn.sql("""select item_code, `%(compare_ref_field)s`,
|
||||||
select item_code, `%(compare_ref_field)s`, `%(compare_field)s`, parenttype, parent from `tab%(target_dt)s`
|
`%(compare_field)s`, parenttype, parent from `tab%(target_dt)s`
|
||||||
where `%(compare_ref_field)s` < `%(compare_field)s` and name="%(name)s" and docstatus=1
|
where `%(compare_ref_field)s` < `%(compare_field)s`
|
||||||
|
and name="%(name)s" and docstatus=1
|
||||||
""" % args, as_dict=1)
|
""" % args, as_dict=1)
|
||||||
if item:
|
if item:
|
||||||
item = item[0]
|
item = item[0]
|
||||||
|
1
setup/doctype/print_heading/test_print_heading.py
Normal file
1
setup/doctype/print_heading/test_print_heading.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
test_records = [[{"print_heading": "_Test Print Heading"}]]
|
@ -0,0 +1 @@
|
|||||||
|
test_records = [[{"title": "_Test Terms and Conditions", "terms": "_Test Terms"}]]
|
@ -53,3 +53,14 @@ def get_monthly_bulk_mail_limit():
|
|||||||
return 999999
|
return 999999
|
||||||
else:
|
else:
|
||||||
return 500
|
return 500
|
||||||
|
|
||||||
|
def get_url():
|
||||||
|
from webnotes.utils import get_request_site_address
|
||||||
|
url = get_request_site_address()
|
||||||
|
if not url or "localhost" in url:
|
||||||
|
subdomain = webnotes.conn.get_value("Website Settings", "Website Settings",
|
||||||
|
"subdomain")
|
||||||
|
if subdomain:
|
||||||
|
if "http" not in subdomain:
|
||||||
|
url = "http://" + subdomain
|
||||||
|
return url
|
@ -91,6 +91,8 @@ def delete(arg=None):
|
|||||||
|
|
||||||
def notify(arg=None):
|
def notify(arg=None):
|
||||||
from webnotes.utils import cstr
|
from webnotes.utils import cstr
|
||||||
|
from startup import get_url
|
||||||
|
|
||||||
fn = webnotes.conn.sql('select first_name, last_name from tabProfile where name=%s', webnotes.user.name)[0]
|
fn = webnotes.conn.sql('select first_name, last_name from tabProfile where name=%s', webnotes.user.name)[0]
|
||||||
if fn[0] or f[1]:
|
if fn[0] or f[1]:
|
||||||
fn = cstr(fn[0]) + (fn[0] and ' ' or '') + cstr(fn[1])
|
fn = cstr(fn[0]) + (fn[0] and ' ' or '') + cstr(fn[1])
|
||||||
@ -111,13 +113,3 @@ def notify(arg=None):
|
|||||||
from webnotes.utils.email_lib import sendmail
|
from webnotes.utils.email_lib import sendmail
|
||||||
sendmail([arg['contact']], sender, message, "You have a message from %s" % (fn,))
|
sendmail([arg['contact']], sender, message, "You have a message from %s" % (fn,))
|
||||||
|
|
||||||
def get_url():
|
|
||||||
from webnotes.utils import get_request_site_address
|
|
||||||
url = get_request_site_address()
|
|
||||||
if not url or "localhost" in url:
|
|
||||||
subdomain = webnotes.conn.get_value("Website Settings", "Website Settings",
|
|
||||||
"subdomain")
|
|
||||||
if subdomain:
|
|
||||||
if "http" not in subdomain:
|
|
||||||
url = "http://" + subdomain
|
|
||||||
return url
|
|
||||||
|
Loading…
Reference in New Issue
Block a user