fix(test): Test cases fixed
This commit is contained in:
parent
f77cd54a6c
commit
2508d11097
@ -226,7 +226,7 @@ class PurchaseInvoice(BuyingController):
|
||||
item.expense_account = warehouse_account[item.warehouse]["account"]
|
||||
else:
|
||||
item.expense_account = stock_not_billed_account
|
||||
|
||||
|
||||
elif not item.expense_account and for_validate:
|
||||
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
|
||||
|
||||
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
|
||||
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": {
|
||||
"doctype": "Stock Entry Detail",
|
||||
"field_map": {
|
||||
"stock_qty": "transfer_qty"
|
||||
"stock_qty": "transfer_qty",
|
||||
"batch_no": "batch_no"
|
||||
},
|
||||
}
|
||||
}, target_doc)
|
||||
|
@ -10,7 +10,8 @@
|
||||
"rate": 5000.0,
|
||||
"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,
|
||||
@ -21,7 +22,8 @@
|
||||
"rate": 1000.0,
|
||||
"uom": "_Test UOM",
|
||||
"stock_uom": "_Test UOM",
|
||||
"source_warehouse": "_Test Warehouse - _TC"
|
||||
"source_warehouse": "_Test Warehouse - _TC",
|
||||
"allow_transfer_for_manufacture": 1
|
||||
}
|
||||
],
|
||||
"docstatus": 1,
|
||||
@ -54,7 +56,8 @@
|
||||
"rate": 5000.0,
|
||||
"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,
|
||||
@ -65,7 +68,8 @@
|
||||
"rate": 1000.0,
|
||||
"uom": "_Test UOM",
|
||||
"stock_uom": "_Test UOM",
|
||||
"source_warehouse": "_Test Warehouse - _TC"
|
||||
"source_warehouse": "_Test Warehouse - _TC",
|
||||
"allow_transfer_for_manufacture": 1
|
||||
}
|
||||
],
|
||||
"docstatus": 1,
|
||||
@ -97,7 +101,8 @@
|
||||
"rate": 5000.0,
|
||||
"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,
|
||||
@ -109,7 +114,8 @@
|
||||
"rate": 1000.0,
|
||||
"uom": "_Test UOM",
|
||||
"stock_uom": "_Test UOM",
|
||||
"source_warehouse": "_Test Warehouse - _TC"
|
||||
"source_warehouse": "_Test Warehouse - _TC",
|
||||
"allow_transfer_for_manufacture": 1
|
||||
}
|
||||
],
|
||||
"docstatus": 1,
|
||||
@ -143,7 +149,8 @@
|
||||
"rate": 3000.0,
|
||||
"uom": "_Test UOM",
|
||||
"stock_uom": "_Test UOM",
|
||||
"source_warehouse": "_Test Warehouse - _TC"
|
||||
"source_warehouse": "_Test Warehouse - _TC",
|
||||
"allow_transfer_for_manufacture": 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)
|
||||
|
||||
self.assertTrue(len(work_orders), len(pln.po_items))
|
||||
|
||||
|
||||
for name in material_requests:
|
||||
mr = frappe.get_doc('Material Request', name[0])
|
||||
mr.cancel()
|
||||
@ -164,7 +164,7 @@ def create_production_plan(**args):
|
||||
mr_items = get_items_for_material_requests(pln.as_dict())
|
||||
for d in mr_items:
|
||||
pln.append('mr_items', d)
|
||||
|
||||
|
||||
if not args.do_not_save:
|
||||
pln.insert()
|
||||
if not args.do_not_submit:
|
||||
@ -182,7 +182,7 @@ def make_bom(**args):
|
||||
'quantity': args.quantity or 1,
|
||||
'company': args.company or '_Test Company'
|
||||
})
|
||||
|
||||
|
||||
for item in args.raw_materials:
|
||||
item_doc = frappe.get_doc('Item', item)
|
||||
|
||||
@ -191,8 +191,8 @@ def make_bom(**args):
|
||||
'qty': 1,
|
||||
'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.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'])
|
||||
|
||||
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.insert()
|
||||
se.submit()
|
||||
|
@ -57,6 +57,7 @@
|
||||
"stock_uom": "_Test UOM",
|
||||
"show_in_website": 1,
|
||||
"website_warehouse": "_Test Warehouse - _TC",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -78,6 +79,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Item Home Desktop 100",
|
||||
"valuation_rate": 100,
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -107,6 +109,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Item Home Desktop 200",
|
||||
"stock_uom": "_Test UOM 1",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -128,6 +131,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Product Bundle Item",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -149,6 +153,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test FG Item",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -170,6 +175,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Non Stock Item",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -191,6 +197,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Serialized Item",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -213,6 +220,7 @@
|
||||
"item_name": "_Test Serialized Item With Series",
|
||||
"serial_no_series": "ABCD.#####",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -234,6 +242,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Item Home Desktop Manufactured",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -255,6 +264,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test FG Item 2",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
@ -276,6 +286,7 @@
|
||||
"item_group": "_Test Item Group Desktops",
|
||||
"item_name": "_Test Variant Item",
|
||||
"stock_uom": "_Test UOM",
|
||||
"gst_hsn_code": "999800",
|
||||
"has_variants": 1,
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
@ -312,6 +323,7 @@
|
||||
"item_group": "_Test Item Group",
|
||||
"item_name": "_Test Item Warehouse Group Wise Reorder",
|
||||
"apply_warehouse_wise_reorder_level": 1,
|
||||
"gst_hsn_code": "999800",
|
||||
"item_defaults": [{
|
||||
"company": "_Test Company",
|
||||
"default_warehouse": "_Test Warehouse Group-C1 - _TC",
|
||||
|
Loading…
x
Reference in New Issue
Block a user