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

bug: frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Valuation Method #26369

Closed
nameduser0 opened this issue Jul 7, 2021 · 1 comment · Fixed by #28876
Assignees
Milestone

Comments

@nameduser0
Copy link
Contributor

nameduser0 commented Jul 7, 2021

Description of the issue

For some Template Items when changing the default warehouse the below error is given when the Valuation Method is not shown and has not been changed

Context information (for bug reports)

Output of bench version

13.6

Stacktrace / full error message

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import_legacy/importer.py", line 404, in upload
    original.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 337, in _save
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 994, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 859, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1148, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1131, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 853, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 136, in on_update
    self.update_variants()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 804, in update_variants
    update_variants(variants, self, publish_progress=False)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 1301, in update_variants
    variant.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 323, in _save
    self._validate()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 517, in _validate
    self.validate_set_only_once()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 563, in validate_set_only_once
    frappe.CannotChangeConstantError)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 432, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 411, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 365, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Valuation Method
@nameduser0 nameduser0 added the bug label Jul 7, 2021
@yadavyk yadavyk added valid can't-reproduce We are unable to reproduce this bug, provide more information. and removed valid labels Jul 8, 2021
@nameduser0

This comment was marked as abuse.

@nameduser0 nameduser0 changed the title bug: Value cannot be changed for Valuation Method bug: frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Valuation Method Jul 29, 2021
@ankush ankush self-assigned this Aug 26, 2021
@ankush ankush added to-validate Old issues pending validation valid and removed to-validate Old issues pending validation can't-reproduce We are unable to reproduce this bug, provide more information. labels Dec 10, 2021
@ankush ankush added this to the v13.18 milestone Dec 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants