ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Found some bugs on Purchase Return

bug

#1

hello, i found some bugs on ERPNEXT version 10.1.36 and version 10.1.42

i make Item A, stock_uom PCS and input UOM Conversion Box = 12 PCS
and then i make PINV (Purchase Invoice) with update stock, Item A qty : 5, UOM : Box, my stock_qty will be 50 pcs,
and then i make return, Item A, qty : -5, UOM : Box
and i get this pop up “Row # 1: Cannot return more than 3.0 for Item 0131180353”

after i check the sales_and_purchase_return.py on Controller’s folder,
i think the dev forgot to input conversion_factor inside function "def get_ref_item_dict(valid_items, ref_item_row):"

i try to put conversion_factor and the problem solved
line : 150

 valid_items.setdefault(ref_item_row.item_code, frappe._dict({
    		"qty": 0,
    		"rate": 0,
    		"stock_qty": 0,
    		"rejected_qty": 0,
    		"received_qty": 0,
    		"serial_no": [],
    		"batch_no": [],
    		"conversion_factor" : 0
    	}))

and line : 161
item_dict["conversion_factor"] += ref_item_row.get('conversion_factor', 0)


#2

Thanks for reporting this Rico_Nova -

Please check github issues for related bug reports and add a link to your observation here.