[Erp5-dev] CurrencyExchange_getExchangeRateList - is it usable?

Sebastien Robin seb at nexedi.com
Mon Feb 5 15:28:49 CET 2007


Le Lundi 5 Février 2007 14:36, Łukasz Nowak a écrit :
> Hello,
>
> As you can read in Message-Id: <200702051132.37265.jerome at nexedi.com> I
> was advised to make my own automagic script for Source Conversion. To
> obtain it I'll have to use
> portal_skins/erp5_base/CurrencyExchange_getExchangeRateList, to fetch
> well price for currency.
>
> Well, I was testing this script. In this script there was used
> 'start_date' but in
> portal_workflow/currency_exchange_line_interaction_workflow/scripts/Currenc
>yExchangeLine_updateMatrix
>
> there is:
> c.setCriterion('stop_date', min=context.getStartDate(), \
> max=context.getStopDate())
>
> if I change it to start_date like:
> c.setCriterion('start_date', min=context.getStartDate(), \
> max=context.getStopDate())
>
> I'm getting exchange rates for my currencies.

This should also work with stop_date.

>
> Well, some questions:
>
>   * is it a bug, which makes
> portal_skins/erp5_base/CurrencyExchange_getExchangeRateList unusable?

It is already used here for erp5_banking business template, and it works 
properly.


>   * what shall be changed? criterion setter on
> portal_workflow/currency_exchange_line_interaction_workflow/scripts/Currenc
>yExchangeLine_updateMatrix from stop_date to start_date or
> portal_skins/erp5_base/CurrencyExchange_getExchangeRateList?

You should see why the stop_date is not taken into account.

>   * shall be portal_skins/erp5_base/CurrencyExchange_getExchangeRateList
> used to calculate conversion of currencies?

Well, here are some suggestions:
- may be an api should be defined on ERP5/Document/Currency.py , we might 
define some methods wich will call script that we can configure into the zmi.
- the returned value of CurrencyExchange_getExchangeRateList is not so 
convenient, it is :
[base_price,discount_price]
but we might have many other kind of prices.

  Seb.

>
> Thanks,
> Luke

-- 
Sebastien Robin, Nexedi Project Manager
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org



More information about the Erp5-dev mailing list