diff --git a/medblocks/medblocks/thirvusoft_customisations/utils/js/reservation_button.js b/medblocks/medblocks/thirvusoft_customisations/utils/js/reservation_button.js index f8fd036..7218f7f 100644 --- a/medblocks/medblocks/thirvusoft_customisations/utils/js/reservation_button.js +++ b/medblocks/medblocks/thirvusoft_customisations/utils/js/reservation_button.js @@ -94,7 +94,7 @@ frappe.ui.form.on("Sales Order Item", label:"Serial No", fieldname:"serial_no", fieldtype:"Link", - options:"Serial No", + options:"Serial No", in_list_view:1 }, { @@ -102,7 +102,7 @@ frappe.ui.form.on("Sales Order Item", fieldname: 'entry_qty', fieldtype: 'Float', in_list_view: 1, - default:row.qty, + default:row.qty, default: 1, hidden:1 } diff --git a/medblocks/medblocks/thirvusoft_customisations/utils/python/item.py b/medblocks/medblocks/thirvusoft_customisations/utils/python/item.py index c206dd2..513b60b 100644 --- a/medblocks/medblocks/thirvusoft_customisations/utils/python/item.py +++ b/medblocks/medblocks/thirvusoft_customisations/utils/python/item.py @@ -24,23 +24,15 @@ def item_auto_series(doc, event): order_by="item_code DESC" ) - last_num = int(re.search(r"(\d+)$", last_code).group(1)) + 1 if last_code else 1 - new_code = f"{abbr}-{last_num:03d}" - + + + new_code = make_autoname(f"{abbr}-.#") doc.item_code = new_code - class TSItem(Item): def validate(self): - #Start - # if not self.item_name: - # self.item_name = self.item_code - #End - - # if not strip_html(cstr(self.description)).strip(): - # self.description = self.item_name - + self.validate_uom() self.validate_description() self.add_default_uom_in_conversion_factor_table() diff --git a/medblocks/medblocks/thirvusoft_customisations/utils/python/sales_order.py b/medblocks/medblocks/thirvusoft_customisations/utils/python/sales_order.py index 15db22f..1b11ed8 100644 --- a/medblocks/medblocks/thirvusoft_customisations/utils/python/sales_order.py +++ b/medblocks/medblocks/thirvusoft_customisations/utils/python/sales_order.py @@ -41,4 +41,4 @@ def reservation_serial_no(doc,a): if item_group == "Opticals": if not item.custom_reservation_serial_number_: - frappe.throw(f"In Row {item.idx}: Choose the Reserved Serial nos") \ No newline at end of file + frappe.throw(f"In Row {item.idx}: Choose the Reserved Serial nos")