mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-21 16:02:15 +00:00
fix: Consider adding warranty period to serial nos (#42051)
(cherry picked from commit 55e2b876a2)
Co-authored-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
This commit is contained in:
@@ -1098,7 +1098,9 @@ def create_serial_nos(item_code, serial_nos):
|
|||||||
|
|
||||||
|
|
||||||
def make_serial_nos(item_code, serial_nos):
|
def make_serial_nos(item_code, serial_nos):
|
||||||
item = frappe.get_cached_value("Item", item_code, ["description", "item_code"], as_dict=1)
|
item = frappe.get_cached_value(
|
||||||
|
"Item", item_code, ["description", "item_code", "item_name", "warranty_period"], as_dict=1
|
||||||
|
)
|
||||||
|
|
||||||
serial_nos = [d.get("serial_no") for d in serial_nos if d.get("serial_no")]
|
serial_nos = [d.get("serial_no") for d in serial_nos if d.get("serial_no")]
|
||||||
existing_serial_nos = frappe.get_all("Serial No", filters={"name": ("in", serial_nos)})
|
existing_serial_nos = frappe.get_all("Serial No", filters={"name": ("in", serial_nos)})
|
||||||
@@ -1123,6 +1125,7 @@ def make_serial_nos(item_code, serial_nos):
|
|||||||
item.item_code,
|
item.item_code,
|
||||||
item.item_name,
|
item.item_name,
|
||||||
item.description,
|
item.description,
|
||||||
|
item.warranty_period or 0,
|
||||||
"Inactive",
|
"Inactive",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1137,6 +1140,7 @@ def make_serial_nos(item_code, serial_nos):
|
|||||||
"item_code",
|
"item_code",
|
||||||
"item_name",
|
"item_name",
|
||||||
"description",
|
"description",
|
||||||
|
"warranty_period",
|
||||||
"status",
|
"status",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user