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

frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting not found #35795

Closed
ashish-greycube opened this issue Jun 20, 2023 · 0 comments
Closed
Labels

Comments

@ashish-greycube
Copy link
Contributor

Information about bug

When migrating from v12->v13 migration fails with following traceback
This seems like a bug in ERPNext. While migrating the doctype is not reloaded before adding permission.


Executing erpnext.patches.v13_0.enable_ksa_vat_docs #1 in kayan.frappe.cloud (_f8e4e799afa4f162)

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 110, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 31, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 433, in migrate
    migrate(context.verbose, skip_failing=skip_failing, skip_search_index=skip_search_index)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 69, in migrate
    frappe.modules.patch_handler.run_all(skip_failing)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 47, in run_all
    run_patch(patch)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 36, in run_patch
    if not run_single(patchmodule=patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 81, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 105, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/enable_ksa_vat_docs.py", line 12, in execute
    add_permissions()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/setup.py", line 39, in add_permissions
    add_permission("KSA VAT Setting", "All", 0)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/permissions.py", line 605, in add_permission
    validate_permissions_for_doctype(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1335, in validate_permissions_for_doctype
    doctype = frappe.get_doc("DocType", doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1080, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 79, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 118, in __init__
    self.load_from_db()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 164, in load_from_db
    _("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 512, in throw
    as_list=as_list,
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 480, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 435, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting not found

Module

other

Version

version-13

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No response

ashish-greycube added a commit to ashish-greycube/erpnext that referenced this issue Jun 20, 2023
When migrating from v12->v13 migration fails
While migrating the doctype is not reloaded before adding permission.
frappe#35795
ashish-greycube added a commit to ashish-greycube/erpnext that referenced this issue Jun 20, 2023
… found

When migrating from v12->v13 migration fails
While migrating the doctype is not reloaded before adding permission. frappe#35795
deepeshgarg007 pushed a commit that referenced this issue Jun 24, 2023
…5797)

fix: frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting not found

When migrating from v12->v13 migration fails
While migrating the doctype is not reloaded before adding permission. #35795
frappe-pr-bot pushed a commit that referenced this issue Jun 28, 2023
## [13.51.7](v13.51.6...v13.51.7) (2023-06-28)

### Bug Fixes

* asset movement (backport [#35918](#35918)) ([#35924](#35924)) ([0bcd047](0bcd047))
* employee link fields in payroll reports ([#619](#619)) ([#35845](#35845)) ([6c4dff3](6c4dff3))
* filter parent warehouses not showing (backport [#35897](#35897)) ([#35900](#35900)) ([bcfd770](bcfd770))
* frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting ([#35797](#35797)) ([3785fe6](3785fe6)), closes [#35795](#35795)
* show non-depreciable assets in fixed asset register (backport [#35858](#35858)) ([#35861](#35861)) ([2e2c319](2e2c319))
* TDS amount calculation post LDC breach ([#35886](#35886)) ([4dd088c](4dd088c))
* use correct fieldname for purchase receipt column in item_wise_purchase_register report (backport [#35828](#35828)) ([#35848](#35848)) ([de529f0](de529f0))
* **ux:** PO Get Items From Open Material Requests (backport [#35894](#35894)) ([#35896](#35896)) ([12b6257](12b6257))

### Performance Improvements

* improve item wise register reports (backport [#35908](#35908)) ([#35912](#35912)) ([4134459](4134459))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants