mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 19:35:09 +00:00
fix: skip discount amount validation when not saving
(cherry picked from commit 0975583388)
This commit is contained in:
@@ -740,7 +740,8 @@ class calculate_taxes_and_totals:
|
|||||||
discount_amount += total_return_discount
|
discount_amount += total_return_discount
|
||||||
|
|
||||||
# validate that discount amount cannot exceed the total before discount
|
# validate that discount amount cannot exceed the total before discount
|
||||||
if (
|
# only during save (i.e. when `_action` is set)
|
||||||
|
if self.doc.get("_action") and (
|
||||||
(grand_total >= 0 and discount_amount > grand_total)
|
(grand_total >= 0 and discount_amount > grand_total)
|
||||||
or (grand_total < 0 and discount_amount < grand_total) # returns
|
or (grand_total < 0 and discount_amount < grand_total) # returns
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user