mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
fix(test): Test cases fixed
This commit is contained in:
@@ -226,7 +226,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
item.expense_account = warehouse_account[item.warehouse]["account"]
|
item.expense_account = warehouse_account[item.warehouse]["account"]
|
||||||
else:
|
else:
|
||||||
item.expense_account = stock_not_billed_account
|
item.expense_account = stock_not_billed_account
|
||||||
|
|
||||||
elif not item.expense_account and for_validate:
|
elif not item.expense_account and for_validate:
|
||||||
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
|
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
return gl_entries
|
return gl_entries
|
||||||
|
|
||||||
def make_supplier_gl_entry(self, gl_entries):
|
def make_supplier_gl_entry(self, gl_entries):
|
||||||
# Checked both rounding_adjustment and rounded_total
|
# Checked both rounding_adjustment and rounded_total
|
||||||
# because rounded_total had value even before introcution of posting GLE based on rounded total
|
# because rounded_total had value even before introcution of posting GLE based on rounded total
|
||||||
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
|
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
|
||||||
|
|
||||||
@@ -859,7 +859,8 @@ def make_stock_entry(source_name, target_doc=None):
|
|||||||
"Purchase Invoice Item": {
|
"Purchase Invoice Item": {
|
||||||
"doctype": "Stock Entry Detail",
|
"doctype": "Stock Entry Detail",
|
||||||
"field_map": {
|
"field_map": {
|
||||||
"stock_qty": "transfer_qty"
|
"stock_qty": "transfer_qty",
|
||||||
|
"batch_no": "batch_no"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}, target_doc)
|
}, target_doc)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
"rate": 5000.0,
|
"rate": 5000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amount": 2000.0,
|
"amount": 2000.0,
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
"rate": 1000.0,
|
"rate": 1000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"docstatus": 1,
|
"docstatus": 1,
|
||||||
@@ -54,7 +56,8 @@
|
|||||||
"rate": 5000.0,
|
"rate": 5000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amount": 2000.0,
|
"amount": 2000.0,
|
||||||
@@ -65,7 +68,8 @@
|
|||||||
"rate": 1000.0,
|
"rate": 1000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"docstatus": 1,
|
"docstatus": 1,
|
||||||
@@ -97,7 +101,8 @@
|
|||||||
"rate": 5000.0,
|
"rate": 5000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amount": 3000.0,
|
"amount": 3000.0,
|
||||||
@@ -109,7 +114,8 @@
|
|||||||
"rate": 1000.0,
|
"rate": 1000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"docstatus": 1,
|
"docstatus": 1,
|
||||||
@@ -143,7 +149,8 @@
|
|||||||
"rate": 3000.0,
|
"rate": 3000.0,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"source_warehouse": "_Test Warehouse - _TC"
|
"source_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"allow_transfer_for_manufacture": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"docstatus": 1,
|
"docstatus": 1,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -48,7 +48,7 @@ class TestProductionPlan(unittest.TestCase):
|
|||||||
filters = {'production_plan': pln.name}, as_list=1)
|
filters = {'production_plan': pln.name}, as_list=1)
|
||||||
|
|
||||||
self.assertTrue(len(work_orders), len(pln.po_items))
|
self.assertTrue(len(work_orders), len(pln.po_items))
|
||||||
|
|
||||||
for name in material_requests:
|
for name in material_requests:
|
||||||
mr = frappe.get_doc('Material Request', name[0])
|
mr = frappe.get_doc('Material Request', name[0])
|
||||||
mr.cancel()
|
mr.cancel()
|
||||||
@@ -164,7 +164,7 @@ def create_production_plan(**args):
|
|||||||
mr_items = get_items_for_material_requests(pln.as_dict())
|
mr_items = get_items_for_material_requests(pln.as_dict())
|
||||||
for d in mr_items:
|
for d in mr_items:
|
||||||
pln.append('mr_items', d)
|
pln.append('mr_items', d)
|
||||||
|
|
||||||
if not args.do_not_save:
|
if not args.do_not_save:
|
||||||
pln.insert()
|
pln.insert()
|
||||||
if not args.do_not_submit:
|
if not args.do_not_submit:
|
||||||
@@ -182,7 +182,7 @@ def make_bom(**args):
|
|||||||
'quantity': args.quantity or 1,
|
'quantity': args.quantity or 1,
|
||||||
'company': args.company or '_Test Company'
|
'company': args.company or '_Test Company'
|
||||||
})
|
})
|
||||||
|
|
||||||
for item in args.raw_materials:
|
for item in args.raw_materials:
|
||||||
item_doc = frappe.get_doc('Item', item)
|
item_doc = frappe.get_doc('Item', item)
|
||||||
|
|
||||||
@@ -191,8 +191,8 @@ def make_bom(**args):
|
|||||||
'qty': 1,
|
'qty': 1,
|
||||||
'uom': item_doc.stock_uom,
|
'uom': item_doc.stock_uom,
|
||||||
'stock_uom': item_doc.stock_uom,
|
'stock_uom': item_doc.stock_uom,
|
||||||
'rate': item_doc.valuation_rate or args.rate
|
'rate': item_doc.valuation_rate or args.rate,
|
||||||
})
|
})
|
||||||
|
|
||||||
bom.insert(ignore_permissions=True)
|
bom.insert(ignore_permissions=True)
|
||||||
bom.submit()
|
bom.submit()
|
||||||
@@ -292,6 +292,7 @@ class TestWorkOrder(unittest.TestCase):
|
|||||||
make_bom(item=fg_item, rate=1000, raw_materials = ['_Test FG Item', '_Test FG Non Stock Item'])
|
make_bom(item=fg_item, rate=1000, raw_materials = ['_Test FG Item', '_Test FG Non Stock Item'])
|
||||||
|
|
||||||
wo = make_wo_order_test_record(production_item = fg_item)
|
wo = make_wo_order_test_record(production_item = fg_item)
|
||||||
|
|
||||||
se = frappe.get_doc(make_stock_entry(wo.name, "Material Transfer for Manufacture", 1))
|
se = frappe.get_doc(make_stock_entry(wo.name, "Material Transfer for Manufacture", 1))
|
||||||
se.insert()
|
se.insert()
|
||||||
se.submit()
|
se.submit()
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
"show_in_website": 1,
|
"show_in_website": 1,
|
||||||
"website_warehouse": "_Test Warehouse - _TC",
|
"website_warehouse": "_Test Warehouse - _TC",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -78,6 +79,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Item Home Desktop 100",
|
"item_name": "_Test Item Home Desktop 100",
|
||||||
"valuation_rate": 100,
|
"valuation_rate": 100,
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -107,6 +109,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Item Home Desktop 200",
|
"item_name": "_Test Item Home Desktop 200",
|
||||||
"stock_uom": "_Test UOM 1",
|
"stock_uom": "_Test UOM 1",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -128,6 +131,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Product Bundle Item",
|
"item_name": "_Test Product Bundle Item",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -149,6 +153,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test FG Item",
|
"item_name": "_Test FG Item",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -170,6 +175,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Non Stock Item",
|
"item_name": "_Test Non Stock Item",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -191,6 +197,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Serialized Item",
|
"item_name": "_Test Serialized Item",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -213,6 +220,7 @@
|
|||||||
"item_name": "_Test Serialized Item With Series",
|
"item_name": "_Test Serialized Item With Series",
|
||||||
"serial_no_series": "ABCD.#####",
|
"serial_no_series": "ABCD.#####",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -234,6 +242,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Item Home Desktop Manufactured",
|
"item_name": "_Test Item Home Desktop Manufactured",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -255,6 +264,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test FG Item 2",
|
"item_name": "_Test FG Item 2",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse - _TC",
|
"default_warehouse": "_Test Warehouse - _TC",
|
||||||
@@ -276,6 +286,7 @@
|
|||||||
"item_group": "_Test Item Group Desktops",
|
"item_group": "_Test Item Group Desktops",
|
||||||
"item_name": "_Test Variant Item",
|
"item_name": "_Test Variant Item",
|
||||||
"stock_uom": "_Test UOM",
|
"stock_uom": "_Test UOM",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"has_variants": 1,
|
"has_variants": 1,
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
@@ -312,6 +323,7 @@
|
|||||||
"item_group": "_Test Item Group",
|
"item_group": "_Test Item Group",
|
||||||
"item_name": "_Test Item Warehouse Group Wise Reorder",
|
"item_name": "_Test Item Warehouse Group Wise Reorder",
|
||||||
"apply_warehouse_wise_reorder_level": 1,
|
"apply_warehouse_wise_reorder_level": 1,
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
"item_defaults": [{
|
"item_defaults": [{
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"default_warehouse": "_Test Warehouse Group-C1 - _TC",
|
"default_warehouse": "_Test Warehouse Group-C1 - _TC",
|
||||||
|
|||||||
Reference in New Issue
Block a user