refactor: Consolidate duplicate zero-quantity transaction Items checks.

This commit is contained in:
Bernd Oliver Sünderhauf
2023-11-14 19:43:26 +01:00
parent b2d8a44199
commit 4918aeb4c6
5 changed files with 10 additions and 22 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 InvalidQtyError, get_taxes_and_charges
from erpnext.controllers.accounts_controller import 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
@@ -295,10 +295,6 @@ class SellingController(StockController):
def get_item_list(self):
il = []
for d in self.get("items"):
if d.qty is None:
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"):
if p.parent_detail_docname == d.name and p.parent_item == d.item_code: