Base Amount To Text
by Michael Viriyananda https://simetri-sinergi.id , Andhitia Rama https://simetri-sinergi.id , OpenSynergy Indonesia https://simetri-sinergi.id
Odoo
Availability |
Odoo Online
Odoo.sh
On Premise
|
Technical Name |
base_amount_to_text |
License | AGPL-3 |
Website | https://simetri-sinergi.id |
Base Amount To Text
This module allows defining method "amount to text" as python code. The method can be registered for each languanges or currencies.
Installation
To install this module, you need to:
- Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-server-tools
- Add the path to this repository in your configuration (addons-path)
- Update the module list
- Go to menu Setting -> Modules -> Local Modules
- Search For Base Amount To Text
- Install the module
Usage
To use this module, you need to:
- Go to menu Setting -> Translations -> Languanges or Go to menu Accounting -> Miscellaneous -> Currencies
- Edit or create one.
- There will be a new field named Amount To Text
- Click add an item
- There will be a new field named Python Definition for Method Amount To Text
- Fill this field with a python code
- To call the method use <model:base.amount_to_text>.amount_to_text(value)
Example code:
... obj_base_amount2text = self.env['base.amount_to_text'] obj_res_currency = self.env['res.currency'] obj_res_lang = self.env['res.lang'] lang = self.obj_res_lang.search( [('code', '=', 'en_US')]) curr = self.obj_res_currency.search( [('name', '=', 'IDR')]) amount2text = self.obj_amount2text.search([ ('currency_id', '=', curr.id), ('lang_id', '=', lang.id)]) result = amount2text.amount_to_text(self.amount_total) ...
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.
Credits
Contributors
- Michael Viriyananda <viriyananda.michael@gmail.com>
- Andhitia Rama <andhitia.r@gmail.com>
Maintainer
This module is maintained by the OpenSynergy Indonesia.
Please log in to comment on this module