test: Add, expand and refine test-cases for zero-quantity transactions.

(cherry picked from commit b2d8a44199)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
#	erpnext/stock/doctype/stock_entry/stock_entry.py
This commit is contained in:
Bernd Oliver Sünderhauf
2023-12-03 15:10:00 +01:00
committed by Mergify
parent fbbae80f92
commit e91a0acbb3
15 changed files with 201 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ from frappe import _, bold, throw
from frappe.utils import cint, flt, get_link_to_form, nowtime
from erpnext.accounts.party import render_address
from erpnext.controllers.accounts_controller import get_taxes_and_charges
from erpnext.controllers.accounts_controller import InvalidQtyError, get_taxes_and_charges
from erpnext.controllers.sales_and_purchase_return import get_rate_for_return
from erpnext.controllers.stock_controller import StockController
from erpnext.stock.doctype.item.item import set_item_default
@@ -317,7 +317,8 @@ class SellingController(StockController):
il = []
for d in self.get("items"):
if d.qty is None:
frappe.throw(_("Row {0}: Qty is mandatory").format(d.idx))
message = _("Row {0}: Qty is mandatory").format(d.idx)
frappe.throw(message, InvalidQtyError)
if self.has_product_bundle(d.item_code):
for p in self.get("packed_items"):