Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Asset Depreciation Error #34634

Closed
nakul80 opened this issue Mar 29, 2023 · 6 comments · Fixed by #34649
Closed

Auto Asset Depreciation Error #34634

nakul80 opened this issue Mar 29, 2023 · 6 comments · Fixed by #34649
Labels

Comments

@nakul80
Copy link

nakul80 commented Mar 29, 2023

Information about bug

Auto Asset Depreciation errors

Module

assets

Version

erpnext": "14.18.2",
frappe": "14.27.0"

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

Please type some additional information that could help us reproduce this issue:
App Versions
{
	"bank_api_integration": "0.0.1",
	"erpnext": "14.18.2",
	"frappe": "14.27.0"
}
Route
Form/Asset Value Adjustment/new-asset-value-adjustment-4
Error Report
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
TypeError: get_asset_value_after_depreciation() missing 1 required positional argument: 'asset_name'
Request Data
{
	"type": "POST",
	"args": {
		"asset": "MI/AT/20/039"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.assets.doctype.asset.asset.get_asset_value_after_depreciation"
}
Response JSON
{
	"exception": "TypeError: get_asset_value_after_depreciation() missing 1 required positional argument: 'asset_name'"
}
@anandbaburajan
Copy link
Contributor

Thanks @nakul80 for reporting. I'm fixing this in #34649.

@nakul80
Copy link
Author

nakul80 commented Aug 30, 2023

Hi @anandbaburajan

Thansk for your help in March. I am getting errors again.

Traceback with variables (most recent call last):
File "apps/erpnext/erpnext/assets/doctype/asset/depreciation.py", line 66, in post_depreciation_entries
make_depreciation_entry(
date = '2023-08-30'
failed_asset_names = ['MI/AT/20/040', 'MI/AT/20/039']
error_log_names = ['dd5a5d3918']
credit_and_debit_accounts_for_asset_category_and_company = {('Computers', 'Man IT Pvt Ltd'): ('Accumulated Depreciations - MI', 'Depreciation - MI')}
depreciation_cost_center_and_depreciation_series_for_company = {'Man IT Pvt Ltd': ('Main - MI', 'DEPR')}
accounting_dimensions = [{'label': 'Item Group', 'disabled': 0, 'fieldname': 'item_group', 'default_dimension': None, 'company': 'Man IT Pvt Ltd', 'mandatory_for_pl': 0, 'mandatory_for_bs': 0}]
asset = ('MI/AT/20/039', 'Computers', 'Man IT Pvt Ltd', 0, 2)
asset_name = 'MI/AT/20/039'
asset_category = 'Computers'
asset_company = 'Man IT Pvt Ltd'
sch_start_idx = 0
sch_end_idx = 2
e = MandatoryError('[Journal Entry, DEPR00001]: user_remark')
error_log = <ErrorLog: dd5a5d3918>
File "apps/erpnext/erpnext/assets/doctype/asset/depreciation.py", line 223, in make_depreciation_entry
raise depreciation_posting_error
asset_name = 'MI/AT/20/039'
date = '2023-08-30'
sch_start_idx = 0
sch_end_idx = 2
credit_and_debit_accounts = ('Accumulated Depreciations - MI', 'Depreciation - MI')
depreciation_cost_center_and_depreciation_series = ('Main - MI', 'DEPR')
accounting_dimensions = [{'label': 'Item Group', 'disabled': 0, 'fieldname': 'item_group', 'default_dimension': None, 'company': 'Man IT Pvt Ltd', 'mandatory_for_pl': 0, 'mandatory_for_bs': 0}]
asset = <Asset: MI/AT/20/039 docstatus=1>
credit_account = 'Accumulated Depreciations - MI'
debit_account = 'Depreciation - MI'
depreciation_cost_center = 'Main - MI'
depreciation_series = 'DEPR'
depreciation_posting_error = MandatoryError('[Journal Entry, DEPR00001]: user_remark')
d = <DepreciationSchedule: dce94d3f68 docstatus=1 parent=MI/AT/20/039>
File "apps/erpnext/erpnext/assets/doctype/asset/depreciation.py", line 200, in make_depreciation_entry
_make_journal_entry_for_depreciation(
asset_name = 'MI/AT/20/039'
date = '2023-08-30'
sch_start_idx = 0
sch_end_idx = 2
credit_and_debit_accounts = ('Accumulated Depreciations - MI', 'Depreciation - MI')
depreciation_cost_center_and_depreciation_series = ('Main - MI', 'DEPR')
accounting_dimensions = [{'label': 'Item Group', 'disabled': 0, 'fieldname': 'item_group', 'default_dimension': None, 'company': 'Man IT Pvt Ltd', 'mandatory_for_pl': 0, 'mandatory_for_bs': 0}]
asset = <Asset: MI/AT/20/039 docstatus=1>
credit_account = 'Accumulated Depreciations - MI'
debit_account = 'Depreciation - MI
depreciation_cost_center = 'Main - MI'
depreciation_series = 'DEPR'
depreciation_posting_error = MandatoryError('[Journal Entry, DEPR00001]: user_remark')
d = <DepreciationSchedule: dce94d3f68 docstatus=1 parent=MI/AT/20/039>
File "apps/erpnext/erpnext/assets/doctype/asset/depreciation.py", line 292, in _make_journal_entry_for_depreciation
je.save()/
/ asset = <Asset: MI/AT/20/039 docstatus=1>
date = '2023-08-30'
depr_schedule = <DepreciationSchedule: dce94d3f68 docstatus=1 parent=MI/AT/20/039>
sch_start_idx = 0
sch_end_idx = 2
depreciation_cost_center = 'Main - MI'
depreciation_series = 'DEPR'
credit_account = 'Accumulated Depreciations - MI'
debit_account = 'Depreciation - MI'
accounting_dimensions = [{'label': 'Item Group', 'disabled': 0, 'fieldname': 'item_group', 'default_dimension': None,
File "apps/frappe/frappe/model/document.py", line 327, in _save
return self.insert()
self = <JournalEntry: DEPR00001>
ignore_permissions = None
ignore_version = None
File "apps/frappe/frappe/model/document.py", line 260, in insert
self._validate()
self = <JournalEntry: DEPR00001>
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "apps/frappe/frappe/model/document.py", line 529, in _validate
self._validate_mandatory()
self = <JournalEntry: DEPR00001>
File "apps/frappe/frappe/model/document.py", line 864, in _validate_mandatory
raise frappe.MandatoryError(
self = <JournalEntry: DEPR00001>
missing = [('user_remark', 'Error: Value missing for Journal Entry: User Remark')]
d = <JournalEntryAccount: 0f2883d388 parent=DEPR00001>
fieldname = 'user_remark'
msg = 'Error: Value missing for Journal Entry: User Remark'
frappe.exceptions.MandatoryError: [Journal Entry, DEPR00001]: user_remark

@anandbaburajan
Copy link
Contributor

Hi @nakul80. I'm not able to reproduce this locally. Also, user_remark is not a mandatory field in JE. Have you done any customizations?

@nakul80
Copy link
Author

nakul80 commented Aug 30, 2023 via email

@nakul80
Copy link
Author

nakul80 commented Aug 30, 2023 via email

@anandbaburajan
Copy link
Contributor

@nakul80 yep, you can try that.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants