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: TypeError while saving Job card #35380

Merged
merged 2 commits into from
May 23, 2023
Merged

Conversation

Vishnu7025
Copy link
Contributor

Screenshot (61)
request.js:457 Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 66, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1607, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 26, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 305, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 327, in _save
return self.insert()
File "apps/frappe/frappe/model/document.py", line 259, in insert
self.run_before_save_methods()
File "apps/frappe/frappe/model/document.py", line 1045, in run_before_save_methods
self.run_method("validate")
File "apps/frappe/frappe/model/document.py", line 914, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1264, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1246, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 911, in fn
return method_object(*args, **kwargs)
File "apps/erpnext/erpnext/manufacturing/doctype/job_card/job_card.py", line 70, in validate
self.set_status()
File "apps/erpnext/erpnext/manufacturing/doctype/job_card/job_card.py", line 733, in set_status
if self.for_quantity <= self.transferred_qty:
TypeError: '<=' not supported between instances of 'NoneType' and 'int'

@Vishnu7025
Copy link
Contributor Author

@rohitwaghchaure @s-aga-r

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #35380 (8c34cc0) into develop (3f5ce43) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #35380   +/-   ##
========================================
  Coverage    63.82%   63.82%           
========================================
  Files          813      813           
  Lines        60209    60260   +51     
========================================
+ Hits         38428    38462   +34     
- Misses       21781    21798   +17     
Impacted Files Coverage Δ
erpnext/manufacturing/doctype/job_card/job_card.py 71.04% <100.00%> (ø)

... and 13 files with indirect coverage changes

@rohitwaghchaure
Copy link
Collaborator

@Vishnu7025 instead of making the field for_quantity mandatory, can you change the below code in the job_card.py

Old Code

if self.for_quantity <= self.transferred_qty:

New Code

if flt(self.for_quantity) <= flt(self.transferred_qty):

@Vishnu7025
Copy link
Contributor Author

@rohitwaghchaure

@s-aga-r s-aga-r merged commit 00bb8ad into frappe:develop May 23, 2023
s-aga-r added a commit that referenced this pull request May 23, 2023
…-35380

fix: TypeError while saving Job card (backport #35380)
s-aga-r added a commit that referenced this pull request May 23, 2023
…-35380

fix: TypeError while saving Job card (backport #35380)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants