mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 11:25:09 +00:00
fix(stock): update company validation for expense account in lcv
(cherry picked from commit 913168e8b6)
This commit is contained in:
@@ -10,6 +10,7 @@ from frappe.query_builder.custom import ConstantColumn
|
|||||||
from frappe.utils import cint, flt
|
from frappe.utils import cint, flt
|
||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
|
from erpnext import is_perpetual_inventory_enabled
|
||||||
from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals
|
from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals
|
||||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
|
|
||||||
@@ -160,6 +161,9 @@ class LandedCostVoucher(Document):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_expense_accounts(self):
|
def validate_expense_accounts(self):
|
||||||
|
if not is_perpetual_inventory_enabled(self.company):
|
||||||
|
return
|
||||||
|
|
||||||
for t in self.taxes:
|
for t in self.taxes:
|
||||||
company = frappe.get_cached_value("Account", t.expense_account, "company")
|
company = frappe.get_cached_value("Account", t.expense_account, "company")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user