[fix] unify packing description and packed item description
This commit is contained in:
parent
e156cd6379
commit
4b6b6fe5a8
@ -523,32 +523,6 @@
|
|||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"fieldname": "packing_description",
|
|
||||||
"fieldtype": "Text Editor",
|
|
||||||
"hidden": 1,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"label": "Packing Description",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "packing_description",
|
|
||||||
"oldfieldtype": "Text",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_width": "300px",
|
|
||||||
"read_only": 1,
|
|
||||||
"report_hide": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0,
|
|
||||||
"width": "300px"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
|
@ -27,14 +27,14 @@ def get_bin_qty(item, warehouse):
|
|||||||
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
||||||
return det and det[0] or frappe._dict()
|
return det and det[0] or frappe._dict()
|
||||||
|
|
||||||
def update_packing_list_item(doc, packing_item_code, qty, main_item_row, packing_description):
|
def update_packing_list_item(doc, packing_item_code, qty, main_item_row, description):
|
||||||
bin = get_bin_qty(packing_item_code, main_item_row.warehouse)
|
bin = get_bin_qty(packing_item_code, main_item_row.warehouse)
|
||||||
item = get_packing_item_details(packing_item_code)
|
item = get_packing_item_details(packing_item_code)
|
||||||
|
|
||||||
# check if exists
|
# check if exists
|
||||||
exists = 0
|
exists = 0
|
||||||
for d in doc.get("packed_items"):
|
for d in doc.get("packed_items"):
|
||||||
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and d.parent_detail_docname == main_item_row.name and d.packing_description == packing_description:
|
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and d.parent_detail_docname == main_item_row.name and d.description == description:
|
||||||
pi, exists = d, 1
|
pi, exists = d, 1
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, packing
|
|||||||
pi.qty = flt(qty)
|
pi.qty = flt(qty)
|
||||||
pi.actual_qty = flt(bin.get("actual_qty"))
|
pi.actual_qty = flt(bin.get("actual_qty"))
|
||||||
pi.projected_qty = flt(bin.get("projected_qty"))
|
pi.projected_qty = flt(bin.get("projected_qty"))
|
||||||
pi.packing_description = packing_description
|
pi.description = description
|
||||||
if not pi.warehouse:
|
if not pi.warehouse:
|
||||||
pi.warehouse = main_item_row.warehouse
|
pi.warehouse = main_item_row.warehouse
|
||||||
if not pi.batch_no:
|
if not pi.batch_no:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user