Merge branch 'master' of github.com:webnotes/erpnext into wsgi
Conflicts: accounts/doctype/sales_invoice/test_sales_invoice.py buying/doctype/purchase_order/test_purchase_order.py stock/doctype/serial_no/serial_no.py stock/doctype/stock_entry/stock_entry.py stock/doctype/stock_entry/test_stock_entry.py stock/doctype/stock_ledger_entry/stock_ledger_entry.py
This commit is contained in:
commit
21abc706b0
@ -103,7 +103,7 @@ class TestPurchaseOrder(unittest.TestCase):
|
||||
po.doc.company = "_Test Company 1"
|
||||
po.doc.conversion_rate = 0.0167
|
||||
self.assertRaises(InvalidWarehouseCompany, po.insert)
|
||||
|
||||
|
||||
def test_uom_integer_validation(self):
|
||||
from utilities.transaction_base import UOMMustBeIntegerError
|
||||
po = webnotes.bean(copy=test_records[0])
|
||||
|
@ -7,7 +7,7 @@ import webnotes
|
||||
from webnotes.utils import cstr, flt, cint
|
||||
from webnotes.model.bean import getlist
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import msgprint
|
||||
from webnotes import msgprint, _
|
||||
import webnotes.defaults
|
||||
from stock.utils import update_bin
|
||||
|
||||
|
@ -177,6 +177,12 @@ class DocType(StockController):
|
||||
webnotes.conn.sql("""update `tab%s` set serial_no = %s
|
||||
where name=%s""" % (dt[0], '%s', '%s'),
|
||||
('\n'.join(serial_nos), item[0]))
|
||||
|
||||
def on_stock_ledger_entry(self):
|
||||
if self.via_stock_ledger and not self.doc.fields.get("__islocal"):
|
||||
self.set_status()
|
||||
self.set_purchase_details()
|
||||
self.set_sales_details()
|
||||
|
||||
def on_stock_ledger_entry(self):
|
||||
if self.via_stock_ledger and not self.doc.fields.get("__islocal"):
|
||||
@ -240,9 +246,8 @@ def update_serial_nos(sle, item_det):
|
||||
serial_nos = []
|
||||
for i in xrange(cint(sle.actual_qty)):
|
||||
serial_nos.append(make_autoname(item_det.serial_no_series))
|
||||
|
||||
webnotes.conn.set(sle, "serial_no", "\n".join(serial_nos))
|
||||
|
||||
|
||||
if sle.serial_no:
|
||||
serial_nos = get_serial_nos(sle.serial_no)
|
||||
for serial_no in serial_nos:
|
||||
@ -280,7 +285,7 @@ def update_serial_nos_after_submit(controller, parentfield):
|
||||
(controller.doc.doctype, controller.doc.name), as_dict=True)
|
||||
|
||||
if not stock_ledger_entries: return
|
||||
|
||||
|
||||
for d in controller.doclist.get({"parentfield": parentfield}):
|
||||
serial_no = None
|
||||
for sle in stock_ledger_entries:
|
||||
|
@ -43,7 +43,6 @@ class TestStockEntry(unittest.TestCase):
|
||||
self._clear_stock_account_balance()
|
||||
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
||||
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
||||
|
||||
webnotes.session.user = "test2@example.com"
|
||||
|
||||
from stock.utils import InvalidWarehouseCompany
|
||||
@ -62,7 +61,6 @@ class TestStockEntry(unittest.TestCase):
|
||||
|
||||
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
||||
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
||||
|
||||
webnotes.session.user = "test@example.com"
|
||||
st1 = webnotes.bean(copy=test_records[0])
|
||||
st1.doc.company = "_Test Company 1"
|
||||
@ -70,7 +68,6 @@ class TestStockEntry(unittest.TestCase):
|
||||
st1.insert()
|
||||
self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
|
||||
|
||||
webnotes.session.user = "test2@example.com"
|
||||
st1 = webnotes.bean(copy=test_records[0])
|
||||
st1.doc.company = "_Test Company 1"
|
||||
st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user