fix: Validate for missing expense account (#36078)
fix: Validate for missing expense account (#36078)
* fix: Validate for missing expense account
* fix: Validate for missing expense account
(cherry picked from commit ce9164ec69)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
@@ -201,6 +201,12 @@ class StockController(AccountsController):
|
||||
warehouse_asset_account = warehouse_account[item_row.get("warehouse")]["account"]
|
||||
|
||||
expense_account = frappe.get_cached_value("Company", self.company, "default_expense_account")
|
||||
if not expense_account:
|
||||
frappe.throw(
|
||||
_(
|
||||
"Please set default cost of goods sold account in company {0} for booking rounding gain and loss during stock transfer"
|
||||
).format(frappe.bold(self.company))
|
||||
)
|
||||
|
||||
gl_list.append(
|
||||
self.get_gl_dict(
|
||||
|
||||
Reference in New Issue
Block a user