mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
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:
@@ -7,7 +7,7 @@ import webnotes
|
|||||||
from webnotes.utils import cstr, flt, cint
|
from webnotes.utils import cstr, flt, cint
|
||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
from webnotes import msgprint
|
from webnotes import msgprint, _
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
from stock.utils import update_bin
|
from stock.utils import update_bin
|
||||||
|
|
||||||
|
|||||||
@@ -184,6 +184,12 @@ class DocType(StockController):
|
|||||||
self.set_purchase_details()
|
self.set_purchase_details()
|
||||||
self.set_sales_details()
|
self.set_sales_details()
|
||||||
|
|
||||||
|
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 process_serial_no(sle):
|
def process_serial_no(sle):
|
||||||
item_det = get_item_details(sle.item_code)
|
item_det = get_item_details(sle.item_code)
|
||||||
validate_serial_no(sle, item_det)
|
validate_serial_no(sle, item_det)
|
||||||
@@ -240,7 +246,6 @@ def update_serial_nos(sle, item_det):
|
|||||||
serial_nos = []
|
serial_nos = []
|
||||||
for i in xrange(cint(sle.actual_qty)):
|
for i in xrange(cint(sle.actual_qty)):
|
||||||
serial_nos.append(make_autoname(item_det.serial_no_series))
|
serial_nos.append(make_autoname(item_det.serial_no_series))
|
||||||
|
|
||||||
webnotes.conn.set(sle, "serial_no", "\n".join(serial_nos))
|
webnotes.conn.set(sle, "serial_no", "\n".join(serial_nos))
|
||||||
|
|
||||||
if sle.serial_no:
|
if sle.serial_no:
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
self._clear_stock_account_balance()
|
self._clear_stock_account_balance()
|
||||||
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
||||||
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
||||||
|
|
||||||
webnotes.session.user = "test2@example.com"
|
webnotes.session.user = "test2@example.com"
|
||||||
|
|
||||||
from stock.utils import InvalidWarehouseCompany
|
from stock.utils import InvalidWarehouseCompany
|
||||||
@@ -62,7 +61,6 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
|
|
||||||
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
webnotes.bean("Profile", "test2@example.com").get_controller()\
|
||||||
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
|
||||||
|
|
||||||
webnotes.session.user = "test@example.com"
|
webnotes.session.user = "test@example.com"
|
||||||
st1 = webnotes.bean(copy=test_records[0])
|
st1 = webnotes.bean(copy=test_records[0])
|
||||||
st1.doc.company = "_Test Company 1"
|
st1.doc.company = "_Test Company 1"
|
||||||
@@ -70,7 +68,6 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
st1.insert()
|
st1.insert()
|
||||||
self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
|
self.assertRaises(UserNotAllowedForWarehouse, st1.submit)
|
||||||
|
|
||||||
webnotes.session.user = "test2@example.com"
|
|
||||||
st1 = webnotes.bean(copy=test_records[0])
|
st1 = webnotes.bean(copy=test_records[0])
|
||||||
st1.doc.company = "_Test Company 1"
|
st1.doc.company = "_Test Company 1"
|
||||||
st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
|
st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1"
|
||||||
|
|||||||
Reference in New Issue
Block a user