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(work order): resolve type error during job card creation #39713

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

Vishnu7025
Copy link
Contributor

@Vishnu7025 Vishnu7025 commented Feb 4, 2024

App Versions

{
	"erpnext": "15.11.0",
	"frappe": "15.12.0",
	"india_compliance": "15.5.1",
	"print_designer": "1.0.0",
	"ss_enterprises": "0.0.1"
}

Route

Form/Work Order/MFG-WO-2024-00024

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1684, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/manufacturing/doctype/work_order/work_order.py", line 1429, in make_job_card
    validate_operation_data(row)
  File "apps/erpnext/erpnext/manufacturing/doctype/work_order/work_order.py", line 1521, in validate_operation_data
    if row.get("qty") > row.get("pending_qty"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'int' and 'NoneType'

Request Data

{
	"type": "POST",
	"args": {
		"work_order": "MFG-WO-2024-00024",
		"operations": "[{\"idx\":1,\"__islocal\":true,\"name\":\"row 1\",\"qty\":2}]"
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.manufacturing.doctype.work_order.work_order.make_job_card",
	"request_id": "b132fc6d-af6e-4eb6-a910-cb56cd6ee23d"
}

Response Data

{
	"exception": "TypeError: '>' not supported between instances of 'int' and 'NoneType'",
	"exc_type": "TypeError",
	"_exc_source": "erpnext (app)"
}

no-docs

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Feb 4, 2024
@Vishnu7025
Copy link
Contributor Author

@rohitwaghchaure Please review

@s-aga-r s-aga-r enabled auto-merge (squash) February 4, 2024 06:30
@s-aga-r s-aga-r added backport version-15-hotfix and removed needs-tests This PR needs automated unit-tests. labels Feb 4, 2024
@s-aga-r s-aga-r merged commit c81d597 into frappe:develop Feb 4, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Feb 4, 2024
s-aga-r pushed a commit that referenced this pull request Feb 4, 2024
…#39713) (#39714)

fix(work order): resolve type error during job card creation (#39713)

fix: type error
(cherry picked from commit c81d597)

Co-authored-by: Vishnu  VS <Vishnuviswambaran2002@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Feb 6, 2024
# [15.12.0](v15.11.1...v15.12.0) (2024-02-06)

### Bug Fixes

* Blanket Order Ordered Quantity (backport [#39725](#39725)) ([#39739](#39739)) ([b126720](b126720))
* conditionally display show btn setting ([e931432](e931432))
* correctly calculate diff amount for included taxes ([#39655](#39655)) ([7f4cd3c](7f4cd3c))
* do not throw validation for cancelled sle ([02f56ee](02f56ee))
* don't overwrite existing terms in transaction ([dcdd3e8](dcdd3e8))
* Exchange rate on MR to PO creation for muticurrency POs ([#39646](#39646)) ([29eb090](29eb090))
* fetch/change tax template on basis of base_net_rate instead of net_rate ([#39448](#39448)) ([d7c7748](d7c7748))
* incorrect landed cost voucher amount ([a40864d](a40864d))
* out of range for valuation_rate column in SE (backport [#39687](#39687)) ([#39691](#39691)) ([41e4632](41e4632))
* Percentage handling in queries ([#39692](#39692)) ([e76f598](e76f598))
* **portal:** show PO pay button if payments installed ([cea4ed6](cea4ed6))
* Pricing rule application/removal on qty change ([#39084](#39084)) ([f310707](f310707))
* production plan date filters for orders (backport [#39702](#39702)) ([#39720](#39720)) ([3eac436](3eac436))
* remove applied pricing rule on qty change (backport [#39688](#39688)) ([#39737](#39737)) ([f246684](f246684))
* remove file from the disk after the completion of reposting ([b582e9c](b582e9c))
* show warehouse title field in sales docs (backport [#39746](#39746)) ([#39755](#39755)) ([53992de](53992de))
* update company in serial no doc (backport [#39733](#39733)) ([#39747](#39747)) ([00e86bf](00e86bf))
* use old serial / batch fields to make serial batch bundle ([282c19e](282c19e))
* **work order:** resolve type error during job card creation (backport [#39713](#39713)) ([#39714](#39714)) ([5fe40ac](5fe40ac))

### Features

* copy emails from lead to customer ([#38647](#38647)) ([986273b](986273b))
* make material request for job card from workstation dashboard ([3bef12c](3bef12c))
* Period-wise closing entries for TB ([#39712](#39712)) ([1822325](1822325))
* reference for POS SI payments ([#39523](#39523)) ([4ee8cf3](4ee8cf3))
* visual plant floor ([75bd1e6](75bd1e6))

### Performance Improvements

* memory consumption for the stock balance report ([#39626](#39626)) ([5e29aab](5e29aab))
* Move dimension validation out of GL Entry doctype ([#39730](#39730)) ([451c288](451c288))
* timeout for auto material request through reorder level ([1b2831b](1b2831b))
* timeout while submitting the purchase receipt entry ([55a8326](55a8326))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 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.

2 participants