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: add Stock UOM when adding new item in POS list #44780

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

Abdeali099
Copy link
Contributor

Issue: Frappe Support - 27653

Error Log
TypeError: e.stock_uom is undefined
    check_stock_availability point-of-sale line 294 > injectedScript:308
    on_cart_update point-of-sale line 294 > injectedScript:308
    item_selected point-of-sale line 294 > injectedScript:306
    bind_events point-of-sale line 294 > injectedScript:38
    jQuery 8
    bind_events point-of-sale line 294 > injectedScript:38
    inti_component point-of-sale line 294 > injectedScript:1
    <anonymous> point-of-sale line 294 > injectedScript:1
    init_item_selector point-of-sale line 294 > injectedScript:306
    prepare_components point-of-sale line 294 > injectedScript:306
    make_app point-of-sale line 294 > injectedScript:306
    callback point-of-sale line 294 > injectedScript:302
    e request.js:85
    200 request.js:133
    call request.js:305
    jQuery 6
    call request.js:279
    call request.js:109
    prepare_app_defaults point-of-sale line 294 > injectedScript:302
    check_opening_entry point-of-sale line 294 > injectedScript:302
    jQuery 12
    call request.js:279
    call request.js:109
    fetch_opening_entry point-of-sale line 294 > injectedScript:302
    check_opening_entry point-of-sale line 294 > injectedScript:302
    <anonymous> point-of-sale line 294 > injectedScript:302
    on_page_load point_of_sale.js:11
    require assets.js:17
    execute assets.js:114
    promise callback*execute assets.js:108
    require assets.js:15
    require assets.js:14
    on_page_load point_of_sale.js:10
point-of-sale line 294 > injectedScript:308:464


Failure Line

const bold_uom = item_row.stock_uom.bold();

Root cause of Issue

In PR #44320, if enough stock is not available, the error message shows Stock UOM instead of UOM to get accurate stock details.

Arguments for creating a new item row when selecting:

const { item_code, batch_no, serial_no, rate, uom } = item;

const new_item = { item_code, batch_no, rate, uom, [field]: value };

These args does not have stock_uom.

Important

Backport to Version-15

@Abdeali099
Copy link
Contributor Author

@ruthra-kumar can you review this?

@ruthra-kumar ruthra-kumar self-requested a review December 23, 2024 06:22
@ruthra-kumar ruthra-kumar self-assigned this Dec 23, 2024
@ruthra-kumar ruthra-kumar merged commit d4b21f5 into frappe:develop Dec 24, 2024
11 checks passed
mergify bot pushed a commit that referenced this pull request Dec 24, 2024
(cherry picked from commit d4b21f5)

# Conflicts:
#	erpnext/selling/page/point_of_sale/pos_controller.js
Abdeali099 added a commit to Abdeali099/erpnext that referenced this pull request Dec 24, 2024
ruthra-kumar added a commit that referenced this pull request Dec 24, 2024
fix: add `Stock UOM` when adding new item in POS list (#44780)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants