[fixes] for testcases
This commit is contained in:
parent
44c1447b60
commit
253de859b4
@ -206,17 +206,17 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "po_detail",
|
"ref_dn_field": "po_detail",
|
||||||
"compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
|
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
|
||||||
["uom", "="]],
|
["uom", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
},
|
},
|
||||||
"Purchase Receipt": {
|
"Purchase Receipt": {
|
||||||
"ref_dn_field": "purchase_receipt",
|
"ref_dn_field": "purchase_receipt",
|
||||||
"compare_fields": [["customer", "="], ["company", "="], ["currency", "="]],
|
"compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]],
|
||||||
},
|
},
|
||||||
"Purchase Receipt Item": {
|
"Purchase Receipt Item": {
|
||||||
"ref_dn_field": "pr_detail",
|
"ref_dn_field": "pr_detail",
|
||||||
"compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
|
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
|
||||||
["uom", "="]],
|
["uom", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Supplier Quotation Item": {
|
"Supplier Quotation Item": {
|
||||||
"ref_dn_field": "supplier_quotation_item",
|
"ref_dn_field": "supplier_quotation_item",
|
||||||
"compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
|
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
|
||||||
["uom", "="]],
|
["uom", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class TestSalesOrder(unittest.TestCase):
|
|||||||
self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].reserved_warehouse, 10.0)
|
self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].reserved_warehouse, 10.0)
|
||||||
|
|
||||||
def test_reserved_qty_for_so_with_packing_list(self):
|
def test_reserved_qty_for_so_with_packing_list(self):
|
||||||
from stock.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
||||||
|
|
||||||
# change item in test so record
|
# change item in test so record
|
||||||
test_record = test_records[0][:]
|
test_record = test_records[0][:]
|
||||||
@ -185,7 +185,7 @@ class TestSalesOrder(unittest.TestCase):
|
|||||||
so.doclist[1].reserved_warehouse, 0.0)
|
so.doclist[1].reserved_warehouse, 0.0)
|
||||||
|
|
||||||
def test_reserved_qty_for_partial_delivery_with_packing_list(self):
|
def test_reserved_qty_for_partial_delivery_with_packing_list(self):
|
||||||
from stock.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
||||||
|
|
||||||
# change item in test so record
|
# change item in test so record
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ class TestSalesOrder(unittest.TestCase):
|
|||||||
so.doclist[1].reserved_warehouse, 20.0)
|
so.doclist[1].reserved_warehouse, 20.0)
|
||||||
|
|
||||||
def test_reserved_qty_for_over_delivery_with_packing_list(self):
|
def test_reserved_qty_for_over_delivery_with_packing_list(self):
|
||||||
from stock.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
|
||||||
|
|
||||||
# change item in test so record
|
# change item in test so record
|
||||||
test_record = webnotes.copy_doclist(test_records[0])
|
test_record = webnotes.copy_doclist(test_records[0])
|
||||||
|
@ -124,6 +124,9 @@ class TestMaterialRequest(unittest.TestCase):
|
|||||||
po_doclist[0].supplier = "_Test Supplier"
|
po_doclist[0].supplier = "_Test Supplier"
|
||||||
po_doclist[1].qty = 27.0
|
po_doclist[1].qty = 27.0
|
||||||
po_doclist[2].qty = 1.5
|
po_doclist[2].qty = 1.5
|
||||||
|
po_doclist[1].schedule_date = "2013-07-09"
|
||||||
|
po_doclist[2].schedule_date = "2013-07-09"
|
||||||
|
|
||||||
|
|
||||||
# check for stopped status of Material Request
|
# check for stopped status of Material Request
|
||||||
po = webnotes.bean(copy=po_doclist)
|
po = webnotes.bean(copy=po_doclist)
|
||||||
|
@ -103,7 +103,7 @@ class DocType(BuyingController):
|
|||||||
},
|
},
|
||||||
"Purchase Order Item": {
|
"Purchase Order Item": {
|
||||||
"ref_dn_field": "prevdoc_detail_docname",
|
"ref_dn_field": "prevdoc_detail_docname",
|
||||||
"compare_fields": [["export_rate", "="], ["project_name", "="], ["warehouse", "="],
|
"compare_fields": [["import_rate", "="], ["project_name", "="], ["warehouse", "="],
|
||||||
["uom", "="], ["item_code", "="]],
|
["uom", "="], ["item_code", "="]],
|
||||||
"is_child_table": True
|
"is_child_table": True
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ class TransactionBase(StatusUpdater):
|
|||||||
for key, val in ref.items():
|
for key, val in ref.items():
|
||||||
ref_doc = {}
|
ref_doc = {}
|
||||||
for d in self.doclist.get({"doctype": source_dt}):
|
for d in self.doclist.get({"doctype": source_dt}):
|
||||||
if d.fields[val["ref_dn_field"]]:
|
if d.fields.get(val["ref_dn_field"]):
|
||||||
ref_doc.setdefault(key, d.fields[val["ref_dn_field"]])
|
ref_doc.setdefault(key, d.fields[val["ref_dn_field"]])
|
||||||
|
|
||||||
if val.get("is_child_table"):
|
if val.get("is_child_table"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user