Merge branch 'staging-fixes' of https://github.com/frappe/erpnext.git into Item-Tax-Template
# Conflicts: # erpnext/accounts/doctype/accounts_settings/accounts_settings.json # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json # erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json # erpnext/accounts/doctype/sales_invoice/sales_invoice.json # erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json # erpnext/buying/doctype/purchase_order/purchase_order.json # erpnext/buying/doctype/purchase_order_item/purchase_order_item.json # erpnext/buying/doctype/supplier/supplier.json # erpnext/buying/doctype/supplier_quotation/supplier_quotation.json # erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json # erpnext/selling/doctype/quotation/quotation.json # erpnext/selling/doctype/quotation_item/quotation_item.json # erpnext/selling/doctype/sales_order/sales_order.json # erpnext/selling/doctype/sales_order_item/sales_order_item.json # erpnext/setup/doctype/item_group/item_group.json # erpnext/stock/doctype/delivery_note/delivery_note.json # erpnext/stock/doctype/delivery_note_item/delivery_note_item.json # erpnext/stock/doctype/item/item.json # erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
This commit is contained in:
@@ -1073,6 +1073,13 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name):
|
||||
data = json.loads(trans_items)
|
||||
for d in data:
|
||||
child_item = frappe.get_doc(parent_doctype + ' Item', d.get("docname"))
|
||||
|
||||
if parent_doctype == "Sales Order" and flt(d.get("qty")) < child_item.delivered_qty:
|
||||
frappe.throw(_("Cannot set quantity less than delivered quantity"))
|
||||
|
||||
if parent_doctype == "Purchase Order" and flt(d.get("qty")) < child_item.received_qty:
|
||||
frappe.throw(_("Cannot set quantity less than received quantity"))
|
||||
|
||||
child_item.qty = flt(d.get("qty"))
|
||||
|
||||
if child_item.billed_amt > (flt(d.get("rate")) * flt(d.get("qty"))):
|
||||
|
||||
Reference in New Issue
Block a user