mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
refactor: backport old subcontracting code
This commit is contained in:
@@ -240,8 +240,13 @@ def validate_item_details(args, item):
|
||||
throw(_("Item {0} is a template, please select one of its variants").format(item.name))
|
||||
|
||||
elif args.transaction_type == "buying" and args.doctype != "Material Request":
|
||||
if args.get("is_subcontracted") and item.is_stock_item:
|
||||
throw(_("Item {0} must be a Non-Stock Item").format(item.name))
|
||||
if args.get("is_subcontracted"):
|
||||
if args.get("is_old_subcontracting_flow"):
|
||||
if item.is_sub_contracted_item != 1:
|
||||
throw(_("Item {0} must be a Sub-contracted Item").format(item.name))
|
||||
else:
|
||||
if item.is_stock_item:
|
||||
throw(_("Item {0} must be a Non-Stock Item").format(item.name))
|
||||
|
||||
|
||||
def get_basic_details(args, item, overwrite_warehouse=True):
|
||||
|
||||
Reference in New Issue
Block a user