frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
17.74k stars 6.76k forks source link

Executing erpnext.patches.v15_0.update_total_number_of_booked_depreciations #42137

Closed dineshpanchal93 closed 1 week ago

dineshpanchal93 commented 2 weeks ago

Information about bug

Executing erpnext.patches.v15_0.update_total_number_of_booked_depreciations

Module

accounts

Version

version-15

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

Updating DocTypes for frappe        : [========================================] 100%
Updating DocTypes for erpnext       : [========================================] 100%
Updating DocTypes for hrms          : [========================================] 100%
Updating DocTypes for india_compliance: [========================================] 100%
Updating DocTypes for reports       : [========================================] 100%
Updating DocTypes for addons_boms   : [========================================] 100%
Updating DocTypes for addon_s_stocks: [========================================] 100%
Updating DocTypes for hr_reports    : [========================================] 100%
Executing erpnext.patches.v15_0.update_total_number_of_booked_depreciations in blissteringepl.com (_289b398fca2e679f)
Queued rebuilding of search index for blissteringepl.com

Traceback with variables (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
      mod_name = 'frappe.utils.bench_helper'
      alter_argv = True
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, origin='/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x7fdb3d1ad8f0, file "/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, origin='/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py...
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x7fdb3d1ad8f0, file "/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, origin='/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>, origin='/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x7fdb3e7dd870>
      fname = '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'
      cached = '/home/blisstering/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc'
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
      ...skipped... 27 vars
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
      commands = {'frappe': <Group frappe>, 'get-frappe-commands': <Command get-frappe-commands>, 'get-frappe-help': <Command get-frappe-help>}
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
      self = <Group None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
      self = <Group None>
      args = ['frappe', '--site', 'blissteringepl.com', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      windows_expand_args = True
      extra = {}
      ctx = <click.core.Context object at 0x7fdb3d7f9b10>
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7fdb3d1d4940>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <Group frappe>
      sub_ctx = <click.core.Context object at 0x7fdb3d079c30>
      ctx = <click.core.Context object at 0x7fdb3d7f9b10>
      self = <Group None>
      __class__ = <class 'click.core.MultiCommand'>
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7fdb3d26bb50>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x7fdb3d07a4a0>
      ctx = <click.core.Context object at 0x7fdb3d079c30>
      self = <Group frappe>
      __class__ = <class 'click.core.MultiCommand'>
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x7fdb3d07a4a0>
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
      _Context__self = <click.core.Context object at 0x7fdb3d07a4a0>
      _Context__callback = <function migrate at 0x7fdb3d234430>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      ctx = <click.core.Context object at 0x7fdb3d07a4a0>
  File "/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x7fdb3d2341f0>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      ctx = <click.core.Context object at 0x7fdb3d07a4a0>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x7fdb3d234160>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/commands/site.py", line 613, in migrate
    SiteMigration(
      context = {'sites': ['blissteringepl.com'], 'force': False, 'verbose': False, 'profile': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import' from '/home/blisstering/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'blissteringepl.com'
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/migrate.py", line 186, in run
    self.run_schema_updates()
      self = <frappe.migrate.SiteMigration object at 0x7fdb3d07a5c0>
      site = 'blissteringepl.com'
      filelock = <function filelock at 0x7fdb3c766d40>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/migrate.py", line 52, in wrapper
    raise e
      args = (<frappe.migrate.SiteMigration object at 0x7fdb3d07a5c0>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x7fdb3c766950>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/migrate.py", line 44, in wrapper
    ret = method(*args, **kwargs)
      args = (<frappe.migrate.SiteMigration object at 0x7fdb3d07a5c0>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x7fdb3c766950>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/migrate.py", line 121, in run_schema_updates
    frappe.modules.patch_handler.run_all(
      self = <frappe.migrate.SiteMigration object at 0x7fdb3d07a5c0>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 76, in run_all
    run_patch(patch)
      patch_type = <PatchType.post_model_sync: 'post_model_sync'>
      executed = {"execute:frappe.reload_doc('core', 'doctype', 'doctype_state', force=True) #2021-12-15", 'execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings")', 'hrms.patches.post_install.update_allocate_on_in_leave_type', 'erpnext.patches.v14_0.update_zero_asset_quantity_field', 'frappe.patches.v13_0.update_newsletter_content_type', 'erpnext.patches.v13_0.update_schedule_type_in_loans', "execute:frappe.reload_doc('desk', 'doctype', 'number_card_link')", "execute:frappe.reload_doc('core', 'doctype', 'error_snapshot')", 'india_compliance.patches.post_install.update_payment_entry_fields', 'execute:frappe.db.sql("delete from `tabWeb Page` where ifnull(template_path, \'\')!=\'\'")', 'frappe.patches.v13_0.rename_custom_client_script', 'frappe.patches.v12_0.move_form_attachments_to_attachments_folder', 'erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item', 'erpnext.patches.v11_1.move_customer_lead_to_dynamic_column', 'execute:frappe.reload_doc("desk", "doctype"...
      run_patch = <function run_all.<locals>.run_patch at 0x7fdb2ee0cb80>
      patches = ["execute:frappe.get_doc('Role', 'Guest').save() # remove desk access", 'frappe.core.doctype.role.patches.v13_set_default_desk_properties', 'frappe.patches.v14_0.update_workspace2 # 06.06.2023', 'frappe.patches.v14_0.drop_data_import_legacy', 'frappe.patches.v14_0.copy_mail_data #08.03.21', 'frappe.patches.v14_0.update_github_endpoints #08-11-2021', 'frappe.patches.v14_0.remove_db_aggregation', 'frappe.patches.v14_0.update_color_names_in_kanban_board_column', 'frappe.patches.v14_0.update_is_system_generated_flag', 'frappe.patches.v14_0.update_auto_account_deletion_duration', 'frappe.patches.v14_0.update_integration_request', 'frappe.patches.v14_0.set_document_expiry_default', 'frappe.patches.v14_0.delete_data_migration_tool', 'frappe.patches.v14_0.set_suspend_email_queue_default', 'frappe.patches.v14_0.different_encryption_key', 'frappe.patches.v14_0.update_multistep_webforms', "execute:frappe.delete_doc('Page', 'background_jobs', ignore_missing=True, force=True)", 'frappe.patches.v14_...
      patch = 'erpnext.patches.v15_0.update_total_number_of_booked_depreciations'
      skip_failing = False
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 62, in run_patch
    if not run_single(patchmodule=patch):
      patch = 'erpnext.patches.v15_0.update_total_number_of_booked_depreciations'
      skip_failing = False
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 152, in run_single
    return execute_patch(patchmodule, method, methodargs)
      patchmodule = 'erpnext.patches.v15_0.update_total_number_of_booked_depreciations'
      method = None
      methodargs = None
      force = False
      conf = <LocalProxy unbound>
  File "/home/blisstering/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 188, in execute_patch
    _patch()
      patchmodule = 'erpnext.patches.v15_0.update_total_number_of_booked_depreciations'
      method = None
      methodargs = None
      has_patch_file = True
      patch = 'erpnext.patches.v15_0.update_total_number_of_booked_depreciations.execute'
      docstring = ''
      _patch = <function execute at 0x7fdb2ed0c280>
      start_time = 1032686.359322773
  File "/home/blisstering/frappe-bench/apps/erpnext/erpnext/patches/v15_0/update_total_number_of_booked_depreciations.py", line 21, in execute
    for je in depr_schedule:
      assets = [{'name': 'ASS/2024-2024/00019', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00018', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00017', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00016', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00015', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00014', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00013', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00012', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00011', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00010', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00009', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00008', 'opening_number_of_booked_depreciations': 0}, {'name': 'ASS/2024-2024/00007', 'opening_number_of_booked_depre...
      asset = {'name': 'ASS/2023-2024/00056', 'opening_number_of_booked_depreciations': 0}
      asset_doc = <Asset: ASS/2023-2024/00056 docstatus=1>
      fb_row = <AssetFinanceBook: 19c8ec9e14 docstatus=1 parent=ASS/2023-2024/00056>
      depr_schedule = None
      total_number_of_booked_depreciations = 0
      je = <DepreciationSchedule: ae23069876 docstatus=1 parent=ACC-ADS-2024-00050>
dineshpanchal93 commented 2 weeks ago

ASS/2023-2024/00056 - asset is already sold

sagarvora commented 1 week ago

@dineshpanchal93 This is not the full traceback. It doesn't show the error at all.