frappe/erpnext

Issue: Stock Entry uses incorrect company when generated from Pick List

Opened this issue · 0 comments

Information about bug

When creating a Stock Entry from a Pick List, the company associated with the Stock Entry is incorrect. This occurs even when the Pick List is created from a Material Request with the correct company.

Module

stock

Version

V14

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

Steps to Reproduce
1
Create a Material Requisition of type "Material Transfer" for a specific company code (e.g. "company2").
2
Create a Picking List from the Requisition.
3
Generate a Stock Entry from the Picking List.
4
Verify that the company code associated with the Stock Entry does not match the company code of the original Requisition ("company2").
Issue Location
The issue is likely located in the `pick_list.py file (lines 865-878) of the `erpnext.stock.doctype.pick_list.` module.
Proposed Solution
To fix this issue, it is suggested to change the line `stock_entry.company = pick_list.get("company") to get the correct company code from the original Material Requisition.