mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-16 08:47:33 +00:00
fix: terms and conditions for material request (#41834)
(cherry picked from commit 4b026d66dc)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -794,6 +794,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)
|
||||||
@@ -849,6 +854,7 @@ def make_material_request(source_name, target_doc=None):
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
target_doc,
|
target_doc,
|
||||||
|
postprocess,
|
||||||
)
|
)
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
|||||||
Reference in New Issue
Block a user