fix: cannot create purchase order from sales order
(cherry picked from commit 58804b8436)
This commit is contained in:
committed by
mergify-bot
parent
fc257fa58d
commit
1cee08f3e9
@@ -693,12 +693,12 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
|
||||
get_ordered_qty: function(item, so) {
|
||||
let ordered_qty = item.ordered_qty;
|
||||
if (so.packed_items) {
|
||||
if (so.packed_items && so.packed_items.length) {
|
||||
// calculate ordered qty based on packed items in case of product bundle
|
||||
let packed_items = so.packed_items.filter(
|
||||
(pi) => pi.parent_detail_docname == item.name
|
||||
);
|
||||
if (packed_items) {
|
||||
if (packed_items && packed_items.length) {
|
||||
ordered_qty = packed_items.reduce(
|
||||
(sum, pi) => sum + flt(pi.ordered_qty),
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user