How it works...

Monetary fields are similar to Float fields, but Odoo is able to represent them correctly in the user interface since it knows what their currency is through the second field.

This currency field is expected to be called currency_id, but we can use whatever field name we like as long as it is indicated using the currency_field optional parameter.

This is very useful when you need to maintain the amounts in different currencies in the same record, for example, if we want to include the currency of the sale order and the currency of the company. You can configure the two fields as fields.Many2one(res.currency) and use the first one for the first amount and the other one for the second amount.

You might like to know that the decimal precision for the amount is taken from the currency definition (the decimal_precision field of the res.currency model).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset