From 6b25708b7a47a7a366cb5cb1a0f68b27f20cab89 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 17 Jul 2015 16:54:25 +0530 Subject: [PATCH] Minor fixes --- erpnext/controllers/accounts_controller.py | 2 +- erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | 1 - erpnext/stock/doctype/stock_entry/stock_entry.py | 1 - erpnext/stock/doctype/stock_entry/test_stock_entry.py | 2 +- .../doctype/stock_reconciliation/test_stock_reconciliation.py | 2 -- 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index d1ce3c6fdc..61b3c5213f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -26,7 +26,7 @@ class AccountsController(TransactionBase): self.validate_return_doc() self.set_total_in_words() - if not self.is_return: + if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return: self.validate_due_date() if self.meta.get_field("is_recurring"): diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 31a2f50a12..a94856d44b 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -71,7 +71,6 @@ class PurchaseReceipt(BuyingController): def validate_purchase_return(self): for d in self.get("items"): - print flt(d.rejected_qty) if self.is_return and flt(d.rejected_qty) != 0: frappe.throw(_("Row #{0}: Rejected Qty can not be entered in Purchase Return").format(d.idx)) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 78e1038292..58a133132f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -51,7 +51,6 @@ class StockEntry(StockController): self.get_stock_and_rate() self.validate_bom() self.validate_finished_goods() - self.validate_return_reference_doc() self.validate_with_material_request() self.validate_valuation_rate() self.set_total_incoming_outgoing_value() diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 5406bdccfb..95196ccf29 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -12,7 +12,7 @@ from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import StockFre from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice from erpnext.stock.stock_ledger import get_previous_sle from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order, create_dn_against_so -from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv, NotUpdateStockError +from erpnext.stock.doctype.stock_entry.stock_entry import NotUpdateStockError from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation def get_sle(**args): diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index eaa82dd23f..dde338611b 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -107,8 +107,6 @@ def create_stock_reconciliation(**args): "valuation_rate": args.rate }) - sr.insert() - sr.submit() return sr