frappe / hrms

Open Source HR and Payroll Software
https://frappe.io/hr
GNU General Public License v3.0
1.39k stars 729 forks source link

holiday reminders error on bench migrate #71

Closed iamejaaz closed 2 years ago

iamejaaz commented 2 years ago

Description of the issue

Context information (for bug reports)

Output of bench version

erpnext 14.2.1
frappe 14.9.0
hrms 1.0.0
payments 0.0.1

Steps to reproduce the issue

  1. run bench update or bench migrate command

Stacktrace / full error message

Migrating erpnext.test
Updating DocTypes for frappe        : [========================================] 100%
Updating DocTypes for erpnext       : [========================================] 100%
Updating DocTypes for payments      : [========================================] 100%
Updating DocTypes for hrms          : [========================================] 100%

Traceback (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,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ejaaz/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/commands/site.py", line 552, in migrate
    SiteMigration(
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/migrate.py", line 177, in run
    self.post_schema_updates()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/migrate.py", line 41, in wrapper
    ret = method(*args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/migrate.py", line 133, in post_schema_updates
    sync_fixtures()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 22, in sync_fixtures
    import_doc(fixtures_path)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 216, in import_doc
    import_file_by_path(
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 145, in import_file_by_path
    import_doc(
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 242, in import_doc
    doc.insert()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 255, in insert
    self.run_before_save_methods()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 1056, in run_before_save_methods
    self.run_method("validate")
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 928, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 1268, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 1250, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/model/document.py", line 925, in fn
    return method_object(*args, **kwargs)
  File "/home/ejaaz/frappe-bench/apps/hrms/hrms/hr/doctype/hr_settings/hr_settings.py", line 21, in validate
    self.validate_frequency_change()
  File "/home/ejaaz/frappe-bench/apps/hrms/hrms/hr/doctype/hr_settings/hr_settings.py", line 53, in validate_frequency_change
    self.show_freq_change_warning(next_monthly_trigger, next_weekly_trigger)
  File "/home/ejaaz/frappe-bench/apps/hrms/hrms/hr/doctype/hr_settings/hr_settings.py", line 68, in show_freq_change_warning
    frappe.msgprint(
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/__init__.py", line 490, in msgprint
    _raise_exception()
  File "/home/ejaaz/frappe-bench/apps/frappe/frappe/__init__.py", line 442, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: Employees will miss holiday reminders from 01-10-2022 until 02-10-2022.  Do you want to proceed with this change?
ankush commented 2 years ago

Exception shouldn't be raised here I think 👀

iamejaaz commented 2 years ago

Exception shouldn't be raised here I think eyes

ohhhhhh, Sorry for that 😬 😅

iamejaaz commented 1 year ago

Hey @saurabh6790 this issue isn't fixed image