mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 17:45:04 +00:00
fix: carry forward the delivered_by_supplier check to PO
(cherry picked from commit f3460ec840)
# Conflicts:
# erpnext/stock/doctype/packed_item/packed_item.json
This commit is contained in:
@@ -1358,11 +1358,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
|
|||||||
suppliers = [item.get("supplier") for item in selected_items if item.get("supplier")]
|
suppliers = [item.get("supplier") for item in selected_items if item.get("supplier")]
|
||||||
suppliers = list(dict.fromkeys(suppliers)) # remove duplicates while preserving order
|
suppliers = list(dict.fromkeys(suppliers)) # remove duplicates while preserving order
|
||||||
|
|
||||||
items_to_map = [
|
items_to_map = [item.get("item_code") for item in selected_items if item.get("item_code")]
|
||||||
item.get("item_code")
|
|
||||||
for item in selected_items
|
|
||||||
if item.get("item_code") and item.get("delivered_by_supplier")
|
|
||||||
]
|
|
||||||
items_to_map = list(set(items_to_map))
|
items_to_map = list(set(items_to_map))
|
||||||
|
|
||||||
if not suppliers:
|
if not suppliers:
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"use_serial_batch_fields",
|
"use_serial_batch_fields",
|
||||||
"column_break_11",
|
"column_break_11",
|
||||||
"serial_and_batch_bundle",
|
"serial_and_batch_bundle",
|
||||||
|
"delivered_by_supplier",
|
||||||
"section_break_bgys",
|
"section_break_bgys",
|
||||||
"serial_no",
|
"serial_no",
|
||||||
"column_break_qlha",
|
"column_break_qlha",
|
||||||
@@ -290,19 +291,35 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "column_break_qlha",
|
"fieldname": "column_break_qlha",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "delivered_by_supplier",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Supplier delivers to Customer",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2025-02-18 13:07:02.789654",
|
"modified": "2025-02-18 13:07:02.789654",
|
||||||
|
=======
|
||||||
|
"modified": "2025-07-09 19:12:45.850219",
|
||||||
|
>>>>>>> f3460ec840 (fix: carry forward the delivered_by_supplier check to PO)
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Packed Item",
|
"name": "Packed Item",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
|
=======
|
||||||
|
"row_format": "Dynamic",
|
||||||
|
"sort_field": "creation",
|
||||||
|
>>>>>>> f3460ec840 (fix: carry forward the delivered_by_supplier check to PO)
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class PackedItem(Document):
|
|||||||
actual_qty: DF.Float
|
actual_qty: DF.Float
|
||||||
batch_no: DF.Link | None
|
batch_no: DF.Link | None
|
||||||
conversion_factor: DF.Float
|
conversion_factor: DF.Float
|
||||||
|
delivered_by_supplier: DF.Check
|
||||||
description: DF.TextEditor | None
|
description: DF.TextEditor | None
|
||||||
incoming_rate: DF.Currency
|
incoming_rate: DF.Currency
|
||||||
item_code: DF.Link | None
|
item_code: DF.Link | None
|
||||||
@@ -209,6 +210,7 @@ def update_packed_item_basic_data(main_item_row, pi_row, packing_item, item_data
|
|||||||
pi_row.uom = item_data.stock_uom
|
pi_row.uom = item_data.stock_uom
|
||||||
pi_row.qty = flt(packing_item.qty) * flt(main_item_row.stock_qty)
|
pi_row.qty = flt(packing_item.qty) * flt(main_item_row.stock_qty)
|
||||||
pi_row.conversion_factor = main_item_row.conversion_factor
|
pi_row.conversion_factor = main_item_row.conversion_factor
|
||||||
|
pi_row.delivered_by_supplier = main_item_row.get("delivered_by_supplier")
|
||||||
|
|
||||||
if not pi_row.description:
|
if not pi_row.description:
|
||||||
pi_row.description = packing_item.get("description")
|
pi_row.description = packing_item.get("description")
|
||||||
|
|||||||
Reference in New Issue
Block a user