fix: terms and conditions for material request (#41834)

This commit is contained in:
rohitwaghchaure
2024-06-10 14:47:03 +05:30
committed by GitHub
parent 36413d14d8
commit 4b026d66dc

View File

@@ -801,6 +801,11 @@ def get_requested_item_qty(sales_order):
def make_material_request(source_name, target_doc=None): def make_material_request(source_name, target_doc=None):
requested_item_qty = get_requested_item_qty(source_name) requested_item_qty = get_requested_item_qty(source_name)
def postprocess(source, target):
if source.tc_name and frappe.db.get_value("Terms and Conditions", source.tc_name, "buying") != 1:
target.tc_name = None
target.terms = None
def get_remaining_qty(so_item): def get_remaining_qty(so_item):
return flt( return flt(
flt(so_item.qty) flt(so_item.qty)
@@ -856,6 +861,7 @@ def make_material_request(source_name, target_doc=None):
}, },
}, },
target_doc, target_doc,
postprocess,
) )
return doc return doc