From 6e1565c32c41a5d8bb5cffc4a74c861b0592ece6 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Mon, 25 Sep 2023 20:08:42 +0530 Subject: [PATCH] fix: set against type in asset --- erpnext/assets/doctype/asset/asset.py | 2 ++ erpnext/assets/doctype/asset_repair/asset_repair.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 0dbed87cf2..a732dec08b 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -606,6 +606,7 @@ class Asset(AccountsController): self.get_gl_dict( { "account": cwip_account, + "against_type": "Account", "against": fixed_asset_account, "remarks": self.get("remarks") or _("Accounting Entry for Asset"), "posting_date": self.available_for_use_date, @@ -621,6 +622,7 @@ class Asset(AccountsController): self.get_gl_dict( { "account": fixed_asset_account, + "against_type": "Account", "against": cwip_account, "remarks": self.get("remarks") or _("Accounting Entry for Asset"), "posting_date": self.available_for_use_date, diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py index 7e95cb2a1b..30c0371ae6 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/asset_repair.py @@ -241,6 +241,7 @@ class AssetRepair(AccountsController): "account": fixed_asset_account, "debit": self.repair_cost, "debit_in_account_currency": self.repair_cost, + "against_type": "Account", "against": pi_expense_account, "voucher_type": self.doctype, "voucher_no": self.name, @@ -260,6 +261,7 @@ class AssetRepair(AccountsController): "account": pi_expense_account, "credit": self.repair_cost, "credit_in_account_currency": self.repair_cost, + "against_type": "Account", "against": fixed_asset_account, "voucher_type": self.doctype, "voucher_no": self.name, @@ -294,6 +296,7 @@ class AssetRepair(AccountsController): "account": item.expense_account or default_expense_account, "credit": item.amount, "credit_in_account_currency": item.amount, + "against_type": "Account", "against": fixed_asset_account, "voucher_type": self.doctype, "voucher_no": self.name, @@ -311,6 +314,7 @@ class AssetRepair(AccountsController): "account": fixed_asset_account, "debit": item.amount, "debit_in_account_currency": item.amount, + "against_type": "Account", "against": item.expense_account or default_expense_account, "voucher_type": self.doctype, "voucher_no": self.name,