Allow creation of account moves from template with amounts in different currency

I was wondering if anyone would be interested to implement code in the account module that can allow users to create templates that will accept monetary amounts in a currency different from that of the company, and will automatically do the conversion using the exchange rate based on the date of the move.

The reason this might be useful for cases where certain non-invoiced expenses such as import duties, payroll, or purchase of used assets are performed in secondary currency. It is much easier for the user to enter the amounts as it is in the selected currency without the need to manually compute the amount in company currency offline and then input the values. It saves effort, time and reduces chances of error on the task to lookup the correct exchange rate to used for the date of the move.

The proposal consists on adding a type called monetary besides numeric that takes a Decimal value, digits and currency code. The currency code is a text field instead of a many2one id associated to a currency. This allow us the flexibility to add currency as a template input field so the user can select the currency he/she wants to register the amounts with. Also we add another type called currency which is a selection to choose a currency.

So when creating the template, for all money related fields, the admin will choose the monetary type and fills the value for the digits and currency. The currency can be left blank, in which case it assumes that this amount is in company currency. If a strict currency is expected, the admin inputs the 3 letter code of the currency, for example EUR, USD, or CNY. If the admin wants the currency to be chosen by the user during the creation of the move, the admin can enter a input field name (the name must a string that is longer than 3 characters so we can distinguish it from a currency code) of type currency so this will take the currency as a input selection value.

During the process of instantiating the account move from the user input, those accounts that are of type asset, liabilities or equity, if no second currency was established at the account level, and the move was entered in a different currency, then we will fill in the amount for this second currency amount field (in the move line). If there was a second currency defined, we will convert the amount to this second currency and fill it in.

Although this feature doesn’t take more than just a few lines of codes, if it is not seen as a good idea to be implemented in the account module, how about implementing it as a separate add-on modules? I have created this module and want to share it as part of the official Tryton modules.

1 Like