Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Module to allow bigger/smaller rate into OCA (account-financial-tools)

by
Eska Yazilim, Levent Karakaş
- 12/05/2017 12:01:32
Kitti,

We have gone pass through a similar challange and let me explain how we handled it in v8. (Currency rate in v9+ is another story)

1) Inverted rate approach leads so many changes on various modules (currency rate update, currency revaluation etc.) so we preferred ingadhoc's approach. (Use internal odoo architecture but add fields to see it inversed and save it as odoo wants).

But this lead conversion problems due to precision. (if y = 1/x then x <> 1/y)

2) We wrote a module called currency_rate_precision which  adds precision to necessary fields in res.currency and res.currency.rate so that (if y = 1/x then x = 1/y) and defined precision as 10 digits. It works like a charm with every module we use (rate update, revalation, invoice currency rate, einvoice etc.). We had a happy life since then.

I can share or contribute it to OCA if you like. Unfortunately it is in old api but this does not really matter since it will only be used in v8.

Let me know if this could be a solution in your case.


2017-05-11 9:38 GMT+03:00 Kitti Upariphutthiphong <kittiu@ecosoft.co.th>:
Hello contributors,

I want to discuss on a needed module for country with small currency like us. The feature to allow input bigger / smaller currency rate.


Form the discussion with some members, we also find out that the similar feature is already PR here,


Summary on the discussion,
  • The (1) and (2) has different approach.
  • (1) is more comlex, it introduce a new "rate_input" field, which converted into correct standard "rate" field as used by Odoo and other addons.
  • (2) is more simple approached, it use 1/rate when inverted.
(2) is simple, we also like, but it seem to have conflict with other addons, i..e, currency_rate_update (don't know rate may be inverted), so the update value can be invalid for some currency.
(1) will not have this problem, as the rate already the converted one.

But there is a good advice that, we can do a glue module between #2 and currency_rate_update which will solve this problem. But then, another question is, it can still have problem with other future module which also use this field ??

Both will work for me, but to proceed, I like to get some suggestion from members first. I can either

1) Help on (2), by adding the glue module.
2) Do new PR as in approach (1)

Kitti










_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


Reference