Merge lp:~openbmsjsc/openobject-server/amount-to-text-refactor into lp:openobject-server
Status: | Work in progress |
---|---|
Proposed branch: | lp:~openbmsjsc/openobject-server/amount-to-text-refactor |
Merge into: | lp:openobject-server |
Diff against target: |
535 lines (+352/-133) 6 files modified
openerp/tools/__init__.py (+5/-2) openerp/tools/amount_to_text.py (+1/-130) openerp/tools/amount_to_text_en.py (+1/-1) openerp/tools/amount_to_text_fr.py (+105/-0) openerp/tools/amount_to_text_nl.py (+105/-0) openerp/tools/amount_to_text_vi.py (+135/-0) |
To merge this branch: | bzr merge lp:~openbmsjsc/openobject-server/amount-to-text-refactor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vo Minh Thu (community) | Needs Fixing | ||
Review via email: mp+61291@code.launchpad.net |
Description of the change
Credit to Ivan Gudym (https:/
This branch is proposed refactoring of amount_to_text* functions.
Current implementation of amount_
To avoid confusion i propose to leave in amount_to_text.py "generic" functions only, and all localization staff turn into amount_
Modules shouldn't direct use any "amount_to_text_XX" function, instead it should call generic amount_to_text.
In localization module, say, Ukraine, we implement some amount_to_text_ua function. Then in init section of module do:
from amount_to_text_ua import amount_to_text_ua
from tools.amount_
add_amount_
Then we can use amount_to_text in localized report:
from tools.amount_
class account_
def __init__(self, cr, uid, name, context):
'time': time,
})
def convert(
return amount_
Main advantage of this is to ability to implement generalized modules, which will just sent lang from context into amount_to_text and get write result.
Unmerged revisions
- 3419. By OpenBMS JSC
-
Forgot to add amount_to_text_vi to module initialization
- 3418. By OpenBMS JSC
-
Refactor amount_to_text functions, credit for Ivan Gudym (https:/
/launchpad. net/~igudym)
Add Vietnamese localization for amount_to_text
Thanks a lot! This is a really good thing to change.
Am I right you left the 'generic code' in amount_to_text_en? In that case, it should be removed as it would be unused.
I would also like that you don't add new the vietnamese code. It would be better in a localization module. The other languages should also be in their respective addons but since they were in the server, you can leave them there for now.