refactor: misc pick list refactors
- make tracking fields read only and no-copy 🤦
- collapse print settings section, most users configure it once and
forget about it, not need to show this.
- call pick list grouping function directly
- use get_descendants_of instead of obscure db function
This commit is contained in:
parent
24a7acaabc
commit
5c3f9019cc
@ -1520,6 +1520,7 @@
|
||||
"fieldname": "per_picked",
|
||||
"fieldtype": "Percent",
|
||||
"label": "% Picked",
|
||||
"no_copy": 1,
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
@ -1527,7 +1528,7 @@
|
||||
"idx": 105,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2022-03-15 21:38:31.437586",
|
||||
"modified": "2022-04-21 08:16:48.316074",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order",
|
||||
|
@ -803,13 +803,15 @@
|
||||
{
|
||||
"fieldname": "picked_qty",
|
||||
"fieldtype": "Float",
|
||||
"label": "Picked Qty"
|
||||
"label": "Picked Qty",
|
||||
"no_copy": 1,
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2022-03-15 20:17:33.984799",
|
||||
"modified": "2022-04-21 08:15:14.010319",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order Item",
|
||||
|
@ -114,6 +114,7 @@
|
||||
"set_only_once": 1
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "print_settings_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Print Settings"
|
||||
@ -129,7 +130,7 @@
|
||||
],
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-10-05 15:08:40.369957",
|
||||
"modified": "2022-04-21 07:56:40.646473",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Pick List",
|
||||
@ -199,5 +200,6 @@
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
@ -11,6 +11,7 @@ from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.mapper import map_child_doc
|
||||
from frappe.utils import cint, floor, flt, today
|
||||
from frappe.utils.nestedset import get_descendants_of
|
||||
|
||||
from erpnext.selling.doctype.sales_order.sales_order import (
|
||||
make_delivery_note as create_delivery_note_from_sales_order,
|
||||
@ -109,7 +110,7 @@ class PickList(Document):
|
||||
|
||||
from_warehouses = None
|
||||
if self.parent_warehouse:
|
||||
from_warehouses = frappe.db.get_descendants("Warehouse", self.parent_warehouse)
|
||||
from_warehouses = get_descendants_of("Warehouse", self.parent_warehouse)
|
||||
|
||||
# Create replica before resetting, to handle empty table on update after submit.
|
||||
locations_replica = self.get("locations")
|
||||
@ -190,8 +191,7 @@ class PickList(Document):
|
||||
frappe.throw(_("Qty of Finished Goods Item should be greater than 0."))
|
||||
|
||||
def before_print(self, settings=None):
|
||||
if self.get("group_same_items"):
|
||||
self.group_similar_items()
|
||||
self.group_similar_items()
|
||||
|
||||
def group_similar_items(self):
|
||||
group_item_qty = defaultdict(float)
|
||||
|
Loading…
x
Reference in New Issue
Block a user