mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
refactored code for reserved qty with testcases
This commit is contained in:
@@ -319,9 +319,9 @@ class DocType(SellingController):
|
||||
webnotes.msgprint("%s Packing Slip(s) Cancelled" % res[0][1])
|
||||
|
||||
|
||||
def update_stock_ledger(self, update_stock, is_stopped = 0):
|
||||
def update_stock_ledger(self, update_stock):
|
||||
self.values = []
|
||||
for d in self.get_item_list(is_stopped):
|
||||
for d in self.get_item_list():
|
||||
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
|
||||
if not d['warehouse']:
|
||||
msgprint("Please enter Warehouse for item %s as it is stock item"
|
||||
@@ -344,8 +344,8 @@ class DocType(SellingController):
|
||||
get_obj('Stock Ledger', 'Stock Ledger').update_stock(self.values)
|
||||
|
||||
|
||||
def get_item_list(self, is_stopped):
|
||||
return get_obj('Sales Common').get_item_list(self, is_stopped)
|
||||
def get_item_list(self):
|
||||
return get_obj('Sales Common').get_item_list(self)
|
||||
|
||||
|
||||
def make_sl_entry(self, d, wh, qty, in_value, update_stock):
|
||||
|
||||
@@ -145,4 +145,23 @@ test_records = [
|
||||
"is_sub_contracted_item": "No",
|
||||
"stock_uom": "_Test UOM"
|
||||
}],
|
||||
[{
|
||||
"doctype": "Item",
|
||||
"item_code": "_Test Sales BOM Item",
|
||||
"item_name": "_Test Sales BOM Item",
|
||||
"description": "_Test Sales BOM Item",
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"is_stock_item": "No",
|
||||
"is_asset_item": "No",
|
||||
"has_batch_no": "No",
|
||||
"has_serial_no": "No",
|
||||
"is_purchase_item": "Yes",
|
||||
"is_sales_item": "Yes",
|
||||
"is_service_item": "No",
|
||||
"is_sample_item": "No",
|
||||
"inspection_required": "No",
|
||||
"is_pro_applicable": "No",
|
||||
"is_sub_contracted_item": "No",
|
||||
"stock_uom": "_Test UOM"
|
||||
}],
|
||||
]
|
||||
20
stock/doctype/sales_bom/test_sales_bom.py
Normal file
20
stock/doctype/sales_bom/test_sales_bom.py
Normal file
@@ -0,0 +1,20 @@
|
||||
test_records = [
|
||||
[
|
||||
{
|
||||
"doctype": "Sales BOM",
|
||||
"new_item_code": "_Test Sales BOM Item"
|
||||
},
|
||||
{
|
||||
"doctype": "Sales BOM Item",
|
||||
"item_code": "_Test Item",
|
||||
"parentfield": "sales_bom_items",
|
||||
"qty": 5.0
|
||||
},
|
||||
{
|
||||
"doctype": "Sales BOM Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"parentfield": "sales_bom_items",
|
||||
"qty": 2.0
|
||||
}
|
||||
],
|
||||
]
|
||||
Reference in New Issue
Block a user