perf: Fetching exchange rate on every line item slows down PO (#25345)

* fix: Dont fetch exchange rates for each line item once fetched at parent
`

* perf: Use price list conversion rate from parent

- If price list conversion rate exists in args already from earlier call, use that
- `get_price_list_currency_and_exchange_rate` wont be called for each child row

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Marica
2021-04-19 11:05:21 +05:30
committed by GitHub
parent dcdd3bebbe
commit e8bc912ffc
2 changed files with 11 additions and 3 deletions

View File

@@ -1103,6 +1103,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
to_currency: to_currency,
args: args
},
freeze: true,
freeze_message: __("Fetching exchange rates ..."),
callback: function(r) {
callback(flt(r.message));
}