fix: linters issue

This commit is contained in:
Rohit Waghchaure 2023-01-09 18:23:22 +05:30
parent d1d4671320
commit 05df8579cd

View File

@ -164,10 +164,7 @@ class Item(Document):
if not self.is_stock_item or self.has_serial_no or self.has_batch_no:
return
if not self.valuation_rate and self.standard_rate:
self.valuation_rate = self.standard_rate
if not self.valuation_rate and not self.is_customer_provided_item:
if not self.valuation_rate and not self.standard_rate and not self.is_customer_provided_item:
frappe.throw(_("Valuation Rate is mandatory if Opening Stock entered"))
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
@ -192,7 +189,7 @@ class Item(Document):
item_code=self.name,
target=default_warehouse,
qty=self.opening_stock,
rate=self.valuation_rate,
rate=self.valuation_rate or self.standard_rate,
company=default.company,
posting_date=getdate(),
posting_time=nowtime(),