Merge pull request #47410 from frappe/mergify/bp/version-15-hotfix/pr-46214

feat: Unit Price Items (backport #46214)
This commit is contained in:
Marica
2025-05-23 17:42:33 +02:00
committed by GitHub
26 changed files with 569 additions and 42 deletions

View File

@@ -1252,6 +1252,9 @@ class AccountsController(TransactionBase):
)
def validate_qty_is_not_zero(self):
if self.flags.allow_zero_qty:
return
for item in self.items:
if self.doctype == "Purchase Receipt" and item.rejected_qty:
continue
@@ -3732,9 +3735,9 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
)
if amount_below_billed_amt and row_rate > 0.0:
frappe.throw(
_("Row #{0}: Cannot set Rate if amount is greater than billed amount for Item {1}.").format(
child_item.idx, child_item.item_code
)
_(
"Row #{0}: Cannot set Rate if the billed amount is greater than the amount for Item {1}."
).format(child_item.idx, child_item.item_code)
)
else:
child_item.rate = row_rate