[minor] fixes after merge with master

This commit is contained in:
Anand Doshi
2013-10-10 18:43:34 +05:30
parent 2eec1eb9a6
commit 9106221ea4
14 changed files with 64 additions and 60 deletions

View File

@@ -641,8 +641,8 @@ class TestSalesInvoice(unittest.TestCase):
return new_si
# if yearly, test 3 repetitions, else test 13 repetitions
count = 3 if no_of_months == 12 else 13
# if yearly, test 1 repetition, else test 5 repetitions
count = 1 if (no_of_months == 12) else 5
for i in xrange(count):
base_si = _test(i)
@@ -653,7 +653,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_serialized(self):
from stock.doctype.stock_entry.test_stock_entry import make_serialized_item
from stock.doctype.stock_ledger_entry.stock_ledger_entry import get_serial_nos
from stock.doctype.serial_no.serial_no import get_serial_nos
se = make_serialized_item()
serial_nos = get_serial_nos(se.doclist[1].serial_no)
@@ -674,7 +674,7 @@ class TestSalesInvoice(unittest.TestCase):
return si
def test_serialized_cancel(self):
from stock.doctype.stock_ledger_entry.stock_ledger_entry import get_serial_nos
from stock.doctype.serial_no.serial_no import get_serial_nos
si = self.test_serialized()
si.cancel()
@@ -686,7 +686,7 @@ class TestSalesInvoice(unittest.TestCase):
"delivery_document_no"))
def test_serialize_status(self):
from stock.doctype.stock_ledger_entry.stock_ledger_entry import SerialNoStatusError, get_serial_nos
from stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos
from stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item()

View File

@@ -64,10 +64,10 @@ def upload():
data, start_idx = get_data(rows, company_abbr, rows[0][0])
except Exception, e:
err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or cstr(e)
err_msg = webnotes.local.message_log and "<br>".join(webnotes.local.message_log) or cstr(e)
messages.append("""<p style='color: red'>%s</p>""" % (err_msg or "No message"))
webnotes.errprint(webnotes.getTraceback())
webnotes.message_log = []
webnotes.local.message_log = []
return messages
return import_vouchers(common_values, data, start_idx, rows[0][0])
@@ -117,11 +117,11 @@ def import_vouchers(common_values, data, start_idx, import_type):
d = data[i][0]
if import_type == "Voucher Import: Two Accounts" and flt(d.get("amount")) == 0:
webnotes.message_log = ["Amount not specified"]
webnotes.local.message_log = ["Amount not specified"]
raise Exception
elif import_type == "Voucher Import: Multiple Accounts" and \
(flt(d.get("total_debit")) == 0 or flt(d.get("total_credit")) == 0):
webnotes.message_log = ["Total Debit and Total Credit amount can not be zero"]
webnotes.local.message_log = ["Total Debit and Total Credit amount can not be zero"]
raise Exception
else:
d.posting_date = parse_date(d.posting_date)
@@ -174,7 +174,7 @@ def import_vouchers(common_values, data, start_idx, import_type):
details.append(detail)
if not details:
webnotes.message_log = ["""No accounts found.
webnotes.local.message_log = ["""No accounts found.
If you entered accounts correctly, please check template once"""]
raise Exception
@@ -193,12 +193,12 @@ def import_vouchers(common_values, data, start_idx, import_type):
webnotes.conn.commit()
except Exception, e:
webnotes.conn.rollback()
err_msg = webnotes.message_log and "<br>".join(webnotes.message_log) or cstr(e)
err_msg = webnotes.local.message_log and "<br>".join(webnotes.local.message_log) or cstr(e)
messages.append("""<p style='color: red'>[row #%s] %s failed: %s</p>"""
% ((start_idx + 1) + i, jv.name or "", err_msg or "No message"))
messages.append("<p style='color: red'>All transactions rolled back</p>")
webnotes.errprint(webnotes.getTraceback())
webnotes.message_log = []
webnotes.local.message_log = []
return messages