Merge pull request #33354 from rohitwaghchaure/fixed-trivial-discount-amount

fix: unsupported operand type(s) for +: 'int' and 'NoneType'
This commit is contained in:
rohitwaghchaure 2022-12-15 17:13:46 +05:30 committed by GitHub
commit 5cbbb5d59e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -828,9 +828,9 @@ def insert_item_price(args):
):
if frappe.has_permission("Item Price", "write"):
price_list_rate = (
(args.rate + args.discount_amount) / args.get("conversion_factor")
(flt(args.rate) + flt(args.discount_amount)) / args.get("conversion_factor")
if args.get("conversion_factor")
else (args.rate + args.discount_amount)
else (flt(args.rate) + flt(args.discount_amount))
)
item_price = frappe.db.get_value(