Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
ddbc2da8
Commit
ddbc2da8
authored
7 years ago
by
Christophe Simonis
Browse files
Options
Downloads
Plain Diff
[MERGE] forward port branch 8.0 up to
7805cf5f
parents
0099074a
7805cf5f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openerp/tools/amount_to_text.py
+10
-6
10 additions, 6 deletions
openerp/tools/amount_to_text.py
with
10 additions
and
6 deletions
openerp/tools/amount_to_text.py
+
10
−
6
View file @
ddbc2da8
...
...
@@ -40,9 +40,13 @@ def _convert_nn_fr(val):
if
val
<
20
:
return
to_19_fr
[
val
]
for
(
dcap
,
dval
)
in
((
k
,
20
+
(
10
*
v
))
for
(
v
,
k
)
in
enumerate
(
tens_fr
)):
if
dval
+
10
>
val
:
if
val
%
10
:
return
dcap
+
'
-
'
+
to_19_fr
[
val
%
10
]
base
=
10
if
dval
in
[
60
,
80
]:
base
=
20
if
dval
+
base
>
val
:
if
val
%
base
:
bond
=
(
val
%
base
in
[
1
,
11
]
and
dval
!=
80
)
and
'
-et-
'
or
'
-
'
return
dcap
+
bond
+
to_19_fr
[
val
%
base
]
return
dcap
def
_convert_nnn_fr
(
val
):
...
...
@@ -55,7 +59,7 @@ def _convert_nnn_fr(val):
word
=
''
(
mod
,
rem
)
=
(
val
%
100
,
val
//
100
)
if
rem
>
0
:
word
=
to_19_fr
[
rem
]
+
'
Cent
'
word
=
(
rem
>
1
and
to_19_fr
[
rem
]
+
'
cents
'
)
or
'
Cent
'
if
mod
>
0
:
word
+=
'
'
if
mod
>
0
:
...
...
@@ -110,7 +114,7 @@ def _convert_nn_nl(val):
for
(
dcap
,
dval
)
in
((
k
,
20
+
(
10
*
v
))
for
(
v
,
k
)
in
enumerate
(
tens_nl
)):
if
dval
+
10
>
val
:
if
val
%
10
:
return
dcap
+
'
-
'
+
to_19_nl
[
val
%
10
]
return
to_19_nl
[
val
%
10
]
+
'
-en-
'
+
dcap
return
dcap
def
_convert_nnn_nl
(
val
):
...
...
@@ -123,7 +127,7 @@ def _convert_nnn_nl(val):
word
=
''
(
mod
,
rem
)
=
(
val
%
100
,
val
//
100
)
if
rem
>
0
:
word
=
to_19_nl
[
rem
]
+
'
Honderd
'
word
=
(
rem
>
1
and
to_19_nl
[
rem
]
+
'
honderd
'
)
or
'
Honderd
'
if
mod
>
0
:
word
+=
'
'
if
mod
>
0
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment