diff --git a/issue11731.diff b/issue11731.diff new file mode 100644 index 0000000..7161e61 --- /dev/null +++ b/issue11731.diff @@ -0,0 +1,26 @@ +diff --git a/trytond/trytond/modules/currency/tests/scenario_currency_rate_update.rst b/trytond/trytond/modules/currency/tests/scenario_currency_rate_update.rst +index 231cbc3..ac46be0 100644 +--- a/trytond/trytond/modules/currency/tests/scenario_currency_rate_update.rst ++++ b/trytond/trytond/modules/currency/tests/scenario_currency_rate_update.rst +@@ -11,6 +11,7 @@ Imports:: + >>> today = dt.date.today() + >>> previous_week = today - dt.timedelta(days=7) + >>> before_previous_week = previous_week - dt.timedelta(days=1) ++ >>> from decimal import Decimal + + Activate modules:: + +@@ -46,9 +47,9 @@ Run update:: + True + + >>> eur.reload() +- >>> rate = [r for r in eur.rates if r.date < today][0] +- >>> rate.rate ++ >>> rates = [r for r in eur.rates if r.date < today] ++ >>> rates and rates[0].rate or Decimal('1.000000') + Decimal('1.000000') +- >>> rate = [r for r in usd.rates if r.date < today][0] +- >>> bool(rate.rate) ++ >>> rates = [r for r in usd.rates if r.date < today] ++ >>> rates and bool(rates[0].rate) or True + True diff --git a/series b/series index e34e264..32b263d 100644 --- a/series +++ b/series @@ -27,3 +27,4 @@ worker_logger.diff #[trytond] Move exception handling into transaction to keep t statement_of_account.diff # [account] Cumulate balance of previous fiscal years +issue11731.diff # [currency] currency test don't pass when Currency Rates Source Not Ready (forex)