mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
Don't throw expense account validation on fetching item details
This commit is contained in:
@@ -144,7 +144,7 @@ class AccountsController(TransactionBase):
|
||||
self.conversion_rate = get_exchange_rate(self.currency,
|
||||
self.company_currency)
|
||||
|
||||
def set_missing_item_details(self):
|
||||
def set_missing_item_details(self, for_validate=False):
|
||||
"""set missing item values"""
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
|
||||
@@ -196,7 +196,7 @@ class AccountsController(TransactionBase):
|
||||
(1.0 - (flt(item.discount_percentage) / 100.0)), item.precision("rate"))
|
||||
|
||||
if self.doctype == "Purchase Invoice":
|
||||
self.set_expense_account()
|
||||
self.set_expense_account(for_validate)
|
||||
|
||||
def set_taxes(self):
|
||||
if not self.meta.get_field("taxes"):
|
||||
|
||||
@@ -62,7 +62,7 @@ class BuyingController(StockController):
|
||||
if getattr(self, "supplier", None):
|
||||
self.update_if_missing(get_party_details(self.supplier, party_type="Supplier", ignore_permissions=self.flags.ignore_permissions))
|
||||
|
||||
self.set_missing_item_details()
|
||||
self.set_missing_item_details(for_validate)
|
||||
|
||||
def set_supplier_from_item_default(self):
|
||||
if self.meta.get_field("supplier") and not self.supplier:
|
||||
|
||||
Reference in New Issue
Block a user