From cce29fabf4975fc60ee7091bb9bfb01814bfd1bc Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Mon, 5 Feb 2018 12:25:51 +0530 Subject: [PATCH] [fix] validation between Selling Price and Valuation Rate should not be validated in the Sales Return entry (#12767) --- erpnext/controllers/selling_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 2ec6b83861..a64e76fdca 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -156,7 +156,7 @@ class SellingController(StockController): last_purchase_rate, is_stock_item = frappe.db.get_value("Item", it.item_code, ["last_purchase_rate", "is_stock_item"]) last_purchase_rate_in_sales_uom = last_purchase_rate / (it.conversion_factor or 1) - if flt(it.base_rate) < flt(last_purchase_rate_in_sales_uom): + if flt(it.base_rate) < flt(last_purchase_rate_in_sales_uom) and not self.is_return: throw_message(it.item_name, last_purchase_rate_in_sales_uom, "last purchase rate") last_valuation_rate = frappe.db.sql(""" @@ -166,7 +166,7 @@ class SellingController(StockController): """, (it.item_code, it.warehouse)) if last_valuation_rate: last_valuation_rate_in_sales_uom = last_valuation_rate[0][0] / (it.conversion_factor or 1) - if is_stock_item and flt(it.base_rate) < flt(last_valuation_rate_in_sales_uom): + if is_stock_item and flt(it.base_rate) < flt(last_valuation_rate_in_sales_uom) and not self.is_return: throw_message(it.name, last_valuation_rate_in_sales_uom, "valuation rate")