Problème de mise a jour dokos v3 -

Bonjour a tous, j’ai lancé une mise a jour de dokos v3 et j’ai un problème avec le module HRMS.

J’ai pu sortir du mode maintenance pour continuer à utiliser dokos, mais comment faire pour résoudre le problème ?

Ci-dessous le message d’erreur :

Updating DocTypes for hrms          : [====================] 100%
Executing hrms.patches.v14_0.add_expense_claim_to_repost_settings in sje.bzh (_7                          a7bb977ac38e4ae)

        Add `Expense Claim` to Repost settings

Queued rebuilding of search index for sje.bzh

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_im                          portlib_external.SourceFileLoader object at 0x7f74d65cf070>, origin='/home/pierr                          e/dokos-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x7f74d3f150b0, file "/home/pierre/dokos-b                          ench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'f                          rappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object                           at 0x7f74d65cf070>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loa                          der=<_frozen_importlib_external.SourceFileLoader object at 0x7f74d65cf070>, orig                          in='/home/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py'), '__anno                          tations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/ho                          me/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '                          /home/pierre/dokos-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpyth                          on-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importli                          b/__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 'warn                          ings' from '/usr/lib/python3.10/warnings.py'>, 'Path': <class...
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x7f74d3f150b0, file "/home/pierre/dokos-b                          ench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'fr                          appe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object a                          t 0x7f74d65cf070>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', load                          er=<_frozen_importlib_external.SourceFileLoader object at 0x7f74d65cf070>, origi                          n='/home/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annot                          ations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/hom                          e/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/                          home/pierre/dokos-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpytho                          n-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib                          /__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.p                          y'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module                           'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warni                          ngs' from '/usr/lib/python3.10/warnings.py'>, 'Path': <class...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_im                          portlib_external.SourceFileLoader object at 0x7f74d65cf070>, origin='/home/pierr                          e/dokos-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x7f74d65c                          f070>
      fname = '/home/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py                          '
      cached = '/home/pierre/dokos-bench/apps/frappe/frappe/utils/__pycache__/be                          nch_helper.cpython-310.pyc'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py", line                           108, in <module>
    main()
      ...skipped... 26 vars
  File "/home/pierre/dokos-bench/apps/frappe/frappe/utils/bench_helper.py", line                           19, 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/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 1130, in __call__
    return self.main(*args, **kwargs)
      self = <Group None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 1055, in main
    rv = self.invoke(ctx)
      self = <Group None>
      args = ['frappe', '--site', 'sje.bzh', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      windows_expand_args = True
      extra = {}
      ctx = <click.core.Context object at 0x7f74d651cee0>
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result a                          t 0x7f74d3fbd750>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <Group frappe>
      sub_ctx = <click.core.Context object at 0x7f74d3e00dc0>
      ctx = <click.core.Context object at 0x7f74d651cee0>
      self = <Group None>
      __class__ = <class 'click.core.MultiCommand'>
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result a                          t 0x7f74d3f2b9a0>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x7f74d3e371f0>
      ctx = <click.core.Context object at 0x7f74d3e00dc0>
      self = <Group frappe>
      __class__ = <class 'click.core.MultiCommand'>
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x7f74d3e371f0>
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/core.py"                          , line 760, in invoke
    return __callback(*args, **kwargs)
      _Context__self = <click.core.Context object at 0x7f74d3e371f0>
      _Context__callback = <function migrate at 0x7f74d3ff5d80>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      ctx = <click.core.Context object at 0x7f74d3e371f0>
  File "/home/pierre/dokos-bench/env/lib/python3.10/site-packages/click/decorato                          rs.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x7f74d3ff5b40>
  File "/home/pierre/dokos-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 0x7f74d3e371f0>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x7f74d3ff5ab0>
  File "/home/pierre/dokos-bench/apps/frappe/frappe/commands/site.py", line 575,                           in migrate
    SiteMigration(
      context = {'sites': ['sje.bzh'], 'force': False, 'verbose': False, 'profil                          e': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import'                           from '/home/pierre/dokos-bench/env/lib/python3.10/site-packages/traceback_with_                          variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'sje.bzh'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/migrate.py", line 175, in ru                          n
    self.run_schema_updates()
      self = <frappe.migrate.SiteMigration object at 0x7f74d3e37370>
      site = 'sje.bzh'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/migrate.py", line 41, in wra                          pper
    ret = method(*args, **kwargs)
      args = (<frappe.migrate.SiteMigration object at 0x7f74d3e37370>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x7f74c6fe7910>
  File "/home/pierre/dokos-bench/apps/frappe/frappe/migrate.py", line 114, in ru                          n_schema_updates
    frappe.modules.patch_handler.run_all(
      self = <frappe.migrate.SiteMigration object at 0x7f74d3e37370>
  File "/home/pierre/dokos-bench/apps/frappe/frappe/modules/patch_handler.py", l                          ine 76, in run_all
    run_patch(patch)
      patch_type = <PatchType.post_model_sync: 'post_model_sync'>
      executed = {'erpnext.patches.v14_0.update_opportunity_currency_fields', 'f                          rappe.patches.v13_0.update_duration_options', 'frappe.patches.v13_0.set_path_for                          _homepage_in_web_page_view', "execute:frappe.reload_doc('desk', 'doctype', 'todo                          ') #2014-12-31-1", 'frappe.patches.v8_0.update_global_search_table', 'erpnext.pa                          tches.v12_0.set_automatically_process_deferred_accounting_in_accounts_settings',                           'erpnext.patches.v12_0.remove_duplicate_leave_ledger_entries #2020-05-22', "exe                          cute:frappe.delete_doc_if_exists('DocType', 'Google Maps Settings')", 'execute:f                          rappe.reload_doc("accounts", "doctype", "POS Payment Method") #2020-05-28', "exe                          cute:frappe.rename_doc('Country', 'Macedonia, Republic of', 'Macedonia', ignore_                          if_exists=True)", 'erpnext.patches.v11_0.rename_members_with_naming_series #04-0                          6-2018', 'execute:frappe.reload_doc("HR", "doctype", "Employee Advance")', 'exec                          ute:frappe.rename_doc("Desk Page", "Getting Started", "Home", force=True)', 'exe                          cute:frappe.delete_doc_if_exists("Page", "stock-analytics...
      run_patch = <function run_all.<locals>.run_patch at 0x7f74c6f2eef0>
      patches = ["execute:frappe.get_doc('Role', 'Guest').save() # remove desk a                          ccess", 'frappe.core.doctype.role.patches.v13_set_default_desk_properties', 'fra                          ppe.patches.v14_0.update_workspace2 #2023-06-06', 'frappe.patches.v14_0.drop_dat                          a_import_legacy', 'frappe.patches.v14_0.copy_mail_data #08.03.21', 'frappe.patch                          es.v14_0.update_github_endpoints #08-11-2021', 'frappe.patches.v14_0.remove_db_a                          ggregation', 'frappe.patches.v14_0.update_color_names_in_kanban_board_column', '                          frappe.patches.v14_0.update_is_system_generated_flag', 'frappe.patches.v14_0.upd                          ate_auto_account_deletion_duration', 'frappe.patches.v14_0.update_integration_re                          quest', 'frappe.patches.v14_0.set_document_expiry_default', 'frappe.patches.v14_                          0.delete_data_migration_tool', 'frappe.patches.v14_0.set_suspend_email_queue_def                          ault', 'frappe.patches.v14_0.delete_payment_gateways', 'frappe.patches.v14_0.dif                          ferent_encryption_key', 'frappe.patches.v14_0.drop_unused_indexes', 'frappe.patc                          hes.v14_0.disable_email_accounts_with_oauth', 'execute:f...
      patch = 'hrms.patches.v14_0.add_expense_claim_to_repost_settings'
      skip_failing = False
  File "/home/pierre/dokos-bench/apps/frappe/frappe/modules/patch_handler.py", l                          ine 62, in run_patch
    if not run_single(patchmodule=patch):
      patch = 'hrms.patches.v14_0.add_expense_claim_to_repost_settings'
      skip_failing = False
  File "/home/pierre/dokos-bench/apps/frappe/frappe/modules/patch_handler.py", l                          ine 151, in run_single
    return execute_patch(patchmodule, method, methodargs)
      patchmodule = 'hrms.patches.v14_0.add_expense_claim_to_repost_settings'
      method = None
      methodargs = None
      force = False
      conf = <LocalProxy unbound>
  File "/home/pierre/dokos-bench/apps/frappe/frappe/modules/patch_handler.py", l                          ine 187, in execute_patch
    _patch()
      patchmodule = 'hrms.patches.v14_0.add_expense_claim_to_repost_settings'
      method = None
      methodargs = None
      has_patch_file = True
      patch = 'hrms.patches.v14_0.add_expense_claim_to_repost_settings.execute'
      docstring = '\n\n\tAdd `Expense Claim` to Repost settings\n'
      _patch = <function execute at 0x7f74c65f4af0>
      start_time = 17459918.214468263
  File "/home/pierre/dokos-bench/apps/hrms/hrms/patches/v14_0/add_expense_claim_                          to_repost_settings.py", line 9, in execute
    repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
      allowed_types = ['Expense Claim']
  File "/home/pierre/dokos-bench/apps/frappe/frappe/__init__.py", line 1210, in                           get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
      args = ('Repost Accounting Ledger Settings',)
      kwargs = {}
      frappe = <module 'frappe' from '/home/pierre/dokos-bench/apps/frappe/frapp                          e/__init__.py'>
  File "/home/pierre/dokos-bench/apps/frappe/frappe/model/document.py", line 73,                           in get_doc
    controller = get_controller(doctype)
      args = ('Repost Accounting Ledger Settings',)
      kwargs = {}
      doctype = 'Repost Accounting Ledger Settings'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/model/base_document.py", lin                          e 77, in get_controller
    return _get_controller()
      _get_controller = <function get_controller.<locals>._get_controller at 0x7                          f74c6f2f250>
      doctype = 'Repost Accounting Ledger Settings'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/model/base_document.py", lin                          e 63, in _get_controller
    module = load_doctype_module(doctype, module_name)
      Document = <class 'frappe.model.document.Document'>
      NestedSet = <class 'frappe.utils.nestedset.NestedSet'>
      module_name = 'Core'
      custom = False
      class_overrides = {'Address': ['erpnext.accounts.custom.address.ERPNextAdd                          ress'], 'Event': ['erpnext.venue.doctype.event_registration.event.event.DokosEve                          nt'], 'Web Form': ['payments.overrides.payment_webform.PaymentWebForm'], 'Employ                          ee': ['hrms.overrides.employee_master.EmployeeMaster'], 'Timesheet': ['hrms.over                          rides.employee_timesheet.EmployeeTimesheet'], 'Payment Entry': ['hrms.overrides.                          employee_payment_entry.EmployeePaymentEntry'], 'Project': ['hrms.overrides.emplo                          yee_project.EmployeeProject']}
      doctype = 'Repost Accounting Ledger Settings'
  File "/home/pierre/dokos-bench/apps/frappe/frappe/modules/utils.py", line 293,                           in load_doctype_module
    raise ImportError(msg) from e
      doctype = 'Repost Accounting Ledger Settings'
      module = 'Core'
      prefix = ''
      suffix = ''
      app = 'frappe'
      key = ('frappe', 'Repost Accounting Ledger Settings', '', '')
      module_name = 'frappe.core.doctype.repost_accounting_ledger_settings.repos                          t_accounting_ledger_settings'
      msg = "Module import failed for Repost Accounting Ledger Settings, the Doc                          Type you're trying to open might be deleted.<br> Error: No module named 'frappe.                          core.doctype.repost_accounting_ledger_settings'"
builtins.ImportError: Module import failed for Repost Accounting Ledger Settings                          , the DocType you're trying to open might be deleted.<br> Error: No module named                           'frappe.core.doctype.repost_accounting_ledger_settings'
zsh: exit 1     bench update --reset --restart-supervisor

Merci d’avance
Pierre

Bonjour Pierre, ce patch-là n’existe pas dans HRMS v3. [1]
Peut-être est-ce qu’une version trop récente d’HRMS est installée ?

Ça peut se vérifier avec la commande suivante :

bench version -f table

Si tu vois develop pour HRMS dans la colonne Branch c’est sûrement la cause du soucis, ça devrait être v3.x.x.

Corentin


  1. patch: update repost settings (c93d4e01) · Commits · Dokos / HRMS · GitLab ↩︎

C’est bon, ca marche. Merci pour la réponse rapide. HRMS était effectivement en develop.

Merci Corentin.

1 Like