mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 07:08:24 +00:00
refactor: Consolidate duplicate zero-quantity transaction Items checks.
(cherry picked from commit 4918aeb4c6)
# Conflicts:
# erpnext/stock/doctype/stock_entry/stock_entry.py
This commit is contained in:
committed by
Mergify
parent
e91a0acbb3
commit
cf45ffdabe
@@ -24,10 +24,13 @@ from frappe.utils import (
|
||||
import erpnext
|
||||
from erpnext.accounts.general_ledger import process_gl_map
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
from erpnext.buying.utils import check_on_hold_or_closed_status
|
||||
=======
|
||||
from erpnext.controllers.accounts_controller import InvalidQtyError
|
||||
>>>>>>> b2d8a44199 (test: Add, expand and refine test-cases for zero-quantity transactions.)
|
||||
=======
|
||||
>>>>>>> 4918aeb4c6 (refactor: Consolidate duplicate zero-quantity transaction Items checks.)
|
||||
from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals
|
||||
from erpnext.manufacturing.doctype.bom.bom import (
|
||||
add_additional_cost,
|
||||
@@ -369,10 +372,8 @@ class StockEntry(StockController):
|
||||
frappe.delete_doc("Stock Entry", d.name)
|
||||
|
||||
def set_transfer_qty(self):
|
||||
self.validate_qty_is_not_zero()
|
||||
for item in self.get("items"):
|
||||
if not flt(item.qty):
|
||||
message = _("Row {0}: Qty is mandatory").format(item.idx)
|
||||
frappe.throw(message, InvalidQtyError, title=_("Zero quantity"))
|
||||
if not flt(item.conversion_factor):
|
||||
frappe.throw(_("Row {0}: UOM Conversion Factor is mandatory").format(item.idx))
|
||||
item.transfer_qty = flt(
|
||||
|
||||
Reference in New Issue
Block a user