refactor: rename field against_pick_list_item
This commit is contained in:
parent
5ae9c2f62b
commit
78fe567419
@ -19,7 +19,7 @@
|
||||
"column_break_7dxj",
|
||||
"from_voucher_type",
|
||||
"against_pick_list",
|
||||
"against_pick_list_item",
|
||||
"from_voucher_detail_no",
|
||||
"section_break_xt4m",
|
||||
"stock_uom",
|
||||
"column_break_grdt",
|
||||
@ -282,15 +282,6 @@
|
||||
"report_hide": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "against_pick_list_item",
|
||||
"fieldtype": "Data",
|
||||
"label": "From Voucher Detail No",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_7dxj",
|
||||
"fieldtype": "Column Break"
|
||||
@ -308,6 +299,15 @@
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "from_voucher_detail_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "From Voucher Detail No",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1
|
||||
}
|
||||
],
|
||||
"hide_toolbar": 1,
|
||||
@ -315,7 +315,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2023-10-19 16:09:08.418544",
|
||||
"modified": "2023-10-19 16:26:46.598043",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Reservation Entry",
|
||||
|
@ -316,21 +316,24 @@ class StockReservationEntry(Document):
|
||||
) -> None:
|
||||
"""Updates total reserved qty in the Pick List."""
|
||||
|
||||
if self.against_pick_list and self.against_pick_list_item:
|
||||
if (
|
||||
self.from_voucher_type == "Pick List" and self.against_pick_list and self.from_voucher_detail_no
|
||||
):
|
||||
sre = frappe.qb.DocType("Stock Reservation Entry")
|
||||
reserved_qty = (
|
||||
frappe.qb.from_(sre)
|
||||
.select(Sum(sre.reserved_qty))
|
||||
.where(
|
||||
(sre.docstatus == 1)
|
||||
& (sre.from_voucher_type == "Pick List")
|
||||
& (sre.against_pick_list == self.against_pick_list)
|
||||
& (sre.against_pick_list_item == self.against_pick_list_item)
|
||||
& (sre.from_voucher_detail_no == self.from_voucher_detail_no)
|
||||
)
|
||||
).run(as_list=True)[0][0] or 0
|
||||
|
||||
frappe.db.set_value(
|
||||
"Pick List Item",
|
||||
self.against_pick_list_item,
|
||||
self.from_voucher_detail_no,
|
||||
reserved_qty_field,
|
||||
reserved_qty,
|
||||
update_modified=update_modified,
|
||||
@ -803,7 +806,7 @@ def create_stock_reservation_entries_for_so_items(
|
||||
|
||||
if against_pick_list:
|
||||
so_item.pick_list = item.get("parent")
|
||||
so_item.pick_list_item = item.get("name")
|
||||
so_item.from_voucher_detail_no = item.get("name")
|
||||
|
||||
items.append(so_item)
|
||||
|
||||
@ -929,7 +932,7 @@ def create_stock_reservation_entries_for_so_items(
|
||||
if against_pick_list:
|
||||
sre.from_voucher_type = "Pick List"
|
||||
sre.against_pick_list = item.pick_list
|
||||
sre.against_pick_list_item = item.pick_list_item
|
||||
sre.from_voucher_detail_no = item.from_voucher_detail_no
|
||||
|
||||
if item.serial_and_batch_bundle:
|
||||
sbb = frappe.get_doc("Serial and Batch Bundle", item.serial_and_batch_bundle)
|
||||
|
@ -555,8 +555,9 @@ class TestStockReservationEntry(FrappeTestCase):
|
||||
(sre.voucher_type == "Sales Order")
|
||||
& (sre.voucher_no == location.sales_order)
|
||||
& (sre.voucher_detail_no == location.sales_order_item)
|
||||
& (sre.from_voucher_type == "Pick List")
|
||||
& (sre.against_pick_list == pl.name)
|
||||
& (sre.against_pick_list_item == location.name)
|
||||
& (sre.from_voucher_detail_no == location.name)
|
||||
)
|
||||
).run(as_dict=True)
|
||||
reserved_sb_details: set[tuple] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user