Lokavaluto / lokavaluto-addons

Addons repository for lokavaluto
GNU General Public License v3.0
6 stars 17 forks source link

[lcc_cyclos_base] inactive account can be selected and problem can rise #246

Open vaab opened 2 years ago

vaab commented 2 years ago

In the following code:

https://github.com/Lokavaluto/lokavaluto-addons/blob/12.0/lcc_cyclos_base/models/res_partner.py#L33

The function to get one cyclos account, doesn't check for status value, and could check for that. Why not check for multiple account and clearly fail early if more than one ? What is the cost of actually support multiple account ?

A bug emerged from this code in a special scenario where 2 accounts where available but only one was active, the inactive one was selected by the given function, and unrelated errors occured (the wrong account was forcePasswordUpdate)... etc...