fix: supplier removed on selection of item (backport #38712) (backport #38732) (#38735)

fix: supplier removed on selection of item (backport #38712) (#38732)

fix: supplier removed on selection of item (#38712)

(cherry picked from commit db24e24882)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit dda95ea892)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-12-14 00:38:47 +05:30
committed by GitHub
parent 4908d03a88
commit d53a9f6530

View File

@@ -391,7 +391,6 @@ def get_basic_details(args, item, overwrite_warehouse=True):
"net_amount": 0.0,
"discount_percentage": 0.0,
"discount_amount": flt(args.discount_amount) or 0.0,
"supplier": get_default_supplier(args, item_defaults, item_group_defaults, brand_defaults),
"update_stock": args.get("update_stock")
if args.get("doctype") in ["Sales Invoice", "Purchase Invoice"]
else 0,
@@ -411,6 +410,10 @@ def get_basic_details(args, item, overwrite_warehouse=True):
}
)
default_supplier = get_default_supplier(args, item_defaults, item_group_defaults, brand_defaults)
if default_supplier:
out.supplier = default_supplier
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
out.update(calculate_service_end_date(args, item))