mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
fix: Consider adding warranty period to serial nos (#42051)
This commit is contained in:
committed by
GitHub
parent
ddaf81fc33
commit
55e2b876a2
@@ -1087,7 +1087,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)})
|
||||||
@@ -1112,6 +1114,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",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1126,6 +1129,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