[fixes] for testcases
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py
index fd80a52..c7135f4 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -206,17 +206,17 @@
},
"Purchase Order Item": {
"ref_dn_field": "po_detail",
- "compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
+ "compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
["uom", "="]],
"is_child_table": True
},
"Purchase Receipt": {
"ref_dn_field": "purchase_receipt",
- "compare_fields": [["customer", "="], ["company", "="], ["currency", "="]],
+ "compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]],
},
"Purchase Receipt Item": {
"ref_dn_field": "pr_detail",
- "compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
+ "compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
["uom", "="]],
"is_child_table": True
}
diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py
index 50eef5d..22cecf6 100644
--- a/buying/doctype/purchase_order/purchase_order.py
+++ b/buying/doctype/purchase_order/purchase_order.py
@@ -64,7 +64,7 @@
},
"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", "="]],
"is_child_table": True
}
diff --git a/selling/doctype/sales_order/test_sales_order.py b/selling/doctype/sales_order/test_sales_order.py
index 23046ed..f157932 100644
--- a/selling/doctype/sales_order/test_sales_order.py
+++ b/selling/doctype/sales_order/test_sales_order.py
@@ -158,7 +158,7 @@
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):
- 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
test_record = test_records[0][:]
@@ -185,7 +185,7 @@
so.doclist[1].reserved_warehouse, 0.0)
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
@@ -235,7 +235,7 @@
so.doclist[1].reserved_warehouse, 20.0)
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
test_record = webnotes.copy_doclist(test_records[0])
diff --git a/stock/doctype/material_request/test_material_request.py b/stock/doctype/material_request/test_material_request.py
index 5d22168..2dbc748 100644
--- a/stock/doctype/material_request/test_material_request.py
+++ b/stock/doctype/material_request/test_material_request.py
@@ -124,6 +124,9 @@
po_doclist[0].supplier = "_Test Supplier"
po_doclist[1].qty = 27.0
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
po = webnotes.bean(copy=po_doclist)
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py
index 9bb4ee1..59c6c32 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -103,7 +103,7 @@
},
"Purchase Order Item": {
"ref_dn_field": "prevdoc_detail_docname",
- "compare_fields": [["export_rate", "="], ["project_name", "="], ["warehouse", "="],
+ "compare_fields": [["import_rate", "="], ["project_name", "="], ["warehouse", "="],
["uom", "="], ["item_code", "="]],
"is_child_table": True
}
diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py
index 5994ae5..30a40da 100644
--- a/utilities/transaction_base.py
+++ b/utilities/transaction_base.py
@@ -303,7 +303,7 @@
for key, val in ref.items():
ref_doc = {}
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"]])
if val.get("is_child_table"):