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

fix: local variable 'stock_rbnb' referenced before assignment #33712

Merged

Conversation

rohitwaghchaure
Copy link
Collaborator

Issue

  self.run_method("on_submit")
  File "apps/frappe/frappe/model/document.py", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1259, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 906, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py", line 92, in on_submit
    self.make_gl_entries()
  File "apps/erpnext/erpnext/controllers/stock_controller.py", line 73, in make_gl_entries
    gl_entries = self.get_gl_entries(warehouse_account)
  File "apps/erpnext/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py", line 253, in get_gl_entries
    self.make_item_gl_entries(gl_entries, warehouse_account)
  File "apps/erpnext/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py", line 295, in make_item_gl_entries
    against_account=stock_rbnb,
UnboundLocalError: local variable 'stock_rbnb' referenced before assignment

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jan 18, 2023
@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #33712 (1de4742) into develop (6b31c27) will decrease coverage by 0.01%.
The diff coverage is 75.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #33712      +/-   ##
===========================================
- Coverage    64.14%   64.14%   -0.01%     
===========================================
  Files          819      819              
  Lines        59160    59161       +1     
===========================================
  Hits         37946    37946              
- Misses       21214    21215       +1     
Impacted Files Coverage Δ
...e/subcontracting_receipt/subcontracting_receipt.py 91.39% <75.00%> (-0.50%) ⬇️

@rohitwaghchaure rohitwaghchaure merged commit e8e21ea into frappe:develop Jan 18, 2023
@rohitwaghchaure rohitwaghchaure added the backport version-14-hotfix backport to version 14 label Jan 18, 2023
rohitwaghchaure added a commit that referenced this pull request Jan 18, 2023
…-33712

fix: local variable 'stock_rbnb' referenced before assignment (backport #33712)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant