Merge pull request #2542 from nabinhait/fix1
In stock entry, difference account can be non-profit-and-loss account
This commit is contained in:
commit
88f8fcb32e
@ -167,7 +167,7 @@ class StockController(AccountsController):
|
|||||||
else:
|
else:
|
||||||
is_expense_account = frappe.db.get_value("Account",
|
is_expense_account = frappe.db.get_value("Account",
|
||||||
item.get("expense_account"), "report_type")=="Profit and Loss"
|
item.get("expense_account"), "report_type")=="Profit and Loss"
|
||||||
if self.doctype not in ("Purchase Receipt", "Stock Reconciliation") and not is_expense_account:
|
if self.doctype not in ("Purchase Receipt", "Stock Reconciliation", "Stock Entry") and not is_expense_account:
|
||||||
frappe.throw(_("Expense / Difference account ({0}) must be a 'Profit or Loss' account")
|
frappe.throw(_("Expense / Difference account ({0}) must be a 'Profit or Loss' account")
|
||||||
.format(item.get("expense_account")))
|
.format(item.get("expense_account")))
|
||||||
if is_expense_account and not item.get("cost_center"):
|
if is_expense_account and not item.get("cost_center"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user