Merge pull request #26458 from rohitwaghchaure/fixed-multi-currency-issue-pre

fix: multi-currency issue
This commit is contained in:
rohitwaghchaure 2021-07-13 16:05:36 +05:30 committed by GitHub
commit bd8699b8a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -713,7 +713,8 @@ def get_bom_item_rate(args, bom_doc):
"conversion_rate": 1, # Passed conversion rate as 1 purposefully, as conversion rate is applied at the end of the function
"conversion_factor": args.get("conversion_factor") or 1,
"plc_conversion_rate": 1,
"ignore_party": True
"ignore_party": True,
"ignore_conversion_rate": True
})
item_doc = frappe.get_cached_doc("Item", args.get("item_code"))
out = frappe._dict()

View File

@ -807,10 +807,14 @@ def check_packing_list(price_list_rate_name, desired_qty, item_code):
def validate_conversion_rate(args, meta):
from erpnext.controllers.accounts_controller import validate_conversion_rate
if (not args.conversion_rate
and args.currency==frappe.get_cached_value('Company', args.company, "default_currency")):
company_currency = frappe.get_cached_value('Company', args.company, "default_currency")
if (not args.conversion_rate and args.currency==company_currency):
args.conversion_rate = 1.0
if (not args.ignore_conversion_rate and args.conversion_rate == 1 and args.currency!=company_currency):
args.conversion_rate = get_exchange_rate(args.currency,
company_currency, args.transaction_date, "for_buying") or 1.0
# validate currency conversion rate
validate_conversion_rate(args.currency, args.conversion_rate,
meta.get_label("conversion_rate"), args.company)