mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
Merge pull request #45031 from frappe/mergify/bp/version-15-hotfix/pr-44999
fix: Added patch and fallback code to prevent future issues similar … (backport #44999)
This commit is contained in:
@@ -103,6 +103,16 @@ class SubcontractingController(StockController):
|
|||||||
_("Row {0}: Item {1} must be a subcontracted item.").format(item.idx, item.item_name)
|
_("Row {0}: Item {1} must be a subcontracted item.").format(item.idx, item.item_name)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (
|
||||||
|
self.doctype == "Subcontracting Order" and not item.sc_conversion_factor
|
||||||
|
): # this condition will only be true if user has recently updated from develop branch
|
||||||
|
service_item_qty = frappe.get_value(
|
||||||
|
"Subcontracting Order Service Item",
|
||||||
|
filters={"purchase_order_item": item.purchase_order_item, "parent": self.name},
|
||||||
|
fieldname=["qty"],
|
||||||
|
)
|
||||||
|
item.sc_conversion_factor = service_item_qty / item.qty
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.doctype not in "Subcontracting Receipt"
|
self.doctype not in "Subcontracting Receipt"
|
||||||
and item.qty
|
and item.qty
|
||||||
|
|||||||
Reference in New Issue
Block a user