Merge branch 'develop' into cost-center-renaming

This commit is contained in:
Nabin Hait 2022-09-15 17:42:13 +05:30 committed by GitHub
commit c5c6a69269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View File

@ -129,6 +129,18 @@ class TestAssetRepair(unittest.TestCase):
def test_gl_entries_with_perpetual_inventory(self): def test_gl_entries_with_perpetual_inventory(self):
set_depreciation_settings_in_company(company="_Test Company with perpetual inventory") set_depreciation_settings_in_company(company="_Test Company with perpetual inventory")
asset_category = frappe.get_doc("Asset Category", "Computers")
asset_category.append(
"accounts",
{
"company_name": "_Test Company with perpetual inventory",
"fixed_asset_account": "_Test Fixed Asset - TCP1",
"accumulated_depreciation_account": "_Test Accumulated Depreciations - TCP1",
"depreciation_expense_account": "_Test Depreciations - TCP1",
},
)
asset_category.save()
asset_repair = create_asset_repair( asset_repair = create_asset_repair(
capitalize_repair_cost=1, capitalize_repair_cost=1,
stock_consumption=1, stock_consumption=1,

View File

@ -389,6 +389,7 @@ class Company(NestedSet):
"capital_work_in_progress_account": "Capital Work in Progress", "capital_work_in_progress_account": "Capital Work in Progress",
"asset_received_but_not_billed": "Asset Received But Not Billed", "asset_received_but_not_billed": "Asset Received But Not Billed",
"expenses_included_in_asset_valuation": "Expenses Included In Asset Valuation", "expenses_included_in_asset_valuation": "Expenses Included In Asset Valuation",
"default_expense_account": "Cost of Goods Sold",
} }
if self.enable_perpetual_inventory: if self.enable_perpetual_inventory:
@ -398,7 +399,6 @@ class Company(NestedSet):
"default_inventory_account": "Stock", "default_inventory_account": "Stock",
"stock_adjustment_account": "Stock Adjustment", "stock_adjustment_account": "Stock Adjustment",
"expenses_included_in_valuation": "Expenses Included In Valuation", "expenses_included_in_valuation": "Expenses Included In Valuation",
"default_expense_account": "Cost of Goods Sold",
} }
) )

View File

@ -729,15 +729,19 @@ def create_stock_reconciliation(**args):
sr.expense_account = args.expense_account or ( sr.expense_account = args.expense_account or (
( (
frappe.get_cached_value("Company", sr.company, "stock_adjustment_account") frappe.get_cached_value("Company", sr.company, "stock_adjustment_account")
or "Stock Adjustment - _TC" or frappe.get_cached_value(
"Account", {"account_type": "Stock Adjustment", "company": sr.company}, "name"
)
) )
if frappe.get_all("Stock Ledger Entry", {"company": sr.company}) if frappe.get_all("Stock Ledger Entry", {"company": sr.company})
else "Temporary Opening - _TC" else frappe.get_cached_value(
"Account", {"account_type": "Temporary", "company": sr.company}, "name"
)
) )
sr.cost_center = ( sr.cost_center = (
args.cost_center args.cost_center
or frappe.get_cached_value("Company", sr.company, "cost_center") or frappe.get_cached_value("Company", sr.company, "cost_center")
or "_Test Cost Center - _TC" or frappe.get_cached_value("Cost Center", filters={"is_group": 0, "company": sr.company})
) )
sr.append( sr.append(