Merge lp:~openerp-dev/openobject-addons/trunk-bug-1015867-api into lp:openobject-addons

Proposed by Arnaud Pineux (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1015867-api
Merge into: lp:openobject-addons
Diff against target: 128 lines (+13/-11)
7 files modified
account_check_writing/account_voucher.py (+4/-2)
account_check_writing/report/check_print.py (+1/-1)
account_voucher/report/account_voucher.py (+2/-2)
account_voucher/report/account_voucher_print.py (+2/-2)
hr_payroll/report/report_payslip.py (+1/-1)
hr_payroll/report/report_payslip_details.py (+1/-1)
l10n_in_hr_payroll/report/report_payroll_advice.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1015867-api
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+133958@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vo Minh Thu (thu) wrote :

Shouldn't the lang be taken out of the context (instead of the user) ?

Why are there all those hard-coded 'en' ?

8001. By Vo Minh Thu

[MERGE] merged trunk.

Unmerged revisions

8001. By Vo Minh Thu

[MERGE] merged trunk.

8000. By Arnaud Pineux (OpenERP)

[FIX] account_check_writing and amout_to_text

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_check_writing/account_voucher.py'
2--- account_check_writing/account_voucher.py 2012-11-29 22:26:45 +0000
3+++ account_check_writing/account_voucher.py 2012-12-04 16:37:27 +0000
4@@ -21,7 +21,7 @@
5
6 from osv import osv,fields
7 from tools.translate import _
8-from tools.amount_to_text_en import amount_to_text
9+from tools.amount_to_text import amount_to_text
10 from lxml import etree
11
12 class account_voucher(osv.osv):
13@@ -51,7 +51,9 @@
14
15 #TODO : generic amount_to_text is not ready yet, otherwise language (and country) and currency can be passed
16 #amount_in_word = amount_to_text(amount, context=context)
17- amount_in_word = amount_to_text(amount)
18+ currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id
19+ lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).lang
20+ amount_in_word = amount_to_text(amount, lang=lang[:2], currency=currency.name)
21 default['value'].update({'amount_in_word':amount_in_word})
22 if journal_id:
23 allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing
24
25=== modified file 'account_check_writing/report/check_print.py'
26--- account_check_writing/report/check_print.py 2012-11-29 22:26:45 +0000
27+++ account_check_writing/report/check_print.py 2012-12-04 16:37:27 +0000
28@@ -21,7 +21,7 @@
29
30 import time
31 from report import report_sxw
32-from tools import amount_to_text_en
33+from tools import amount_to_text
34
35 class report_print_check(report_sxw.rml_parse):
36 def __init__(self, cr, uid, name, context):
37
38=== modified file 'account_voucher/report/account_voucher.py'
39--- account_voucher/report/account_voucher.py 2012-11-29 22:26:45 +0000
40+++ account_voucher/report/account_voucher.py 2012-12-04 16:37:27 +0000
41@@ -21,7 +21,7 @@
42
43 import time
44 from report import report_sxw
45-from tools import amount_to_text_en
46+from tools import amount_to_text
47
48 class report_voucher(report_sxw.rml_parse):
49 def __init__(self, cr, uid, name, context):
50@@ -36,7 +36,7 @@
51 })
52
53 def convert(self, amount, cur):
54- amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
55+ amt_en = amount_to_text.amount_to_text(amount, 'en', cur)
56 return amt_en
57
58 def get_title(self, type):
59
60=== modified file 'account_voucher/report/account_voucher_print.py'
61--- account_voucher/report/account_voucher_print.py 2012-11-29 22:26:45 +0000
62+++ account_voucher/report/account_voucher_print.py 2012-12-04 16:37:27 +0000
63@@ -21,7 +21,7 @@
64
65 import time
66 from report import report_sxw
67-from tools import amount_to_text_en
68+from tools import amount_to_text
69
70 class report_voucher_print(report_sxw.rml_parse):
71 def __init__(self, cr, uid, name, context):
72@@ -35,7 +35,7 @@
73 })
74
75 def convert(self, amount, cur):
76- amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
77+ amt_en = amount_to_text.amount_to_text(amount, 'en', cur)
78 return amt_en
79
80 def get_lines(self, voucher):
81
82=== modified file 'hr_payroll/report/report_payslip.py'
83--- hr_payroll/report/report_payslip.py 2012-11-29 22:26:45 +0000
84+++ hr_payroll/report/report_payslip.py 2012-12-04 16:37:27 +0000
85@@ -23,7 +23,7 @@
86 ##############################################################################
87
88 from report import report_sxw
89-from tools import amount_to_text_en
90+from tools import amount_to_text
91
92 class payslip_report(report_sxw.rml_parse):
93
94
95=== modified file 'hr_payroll/report/report_payslip_details.py'
96--- hr_payroll/report/report_payslip_details.py 2012-11-29 22:26:45 +0000
97+++ hr_payroll/report/report_payslip_details.py 2012-12-04 16:37:27 +0000
98@@ -23,7 +23,7 @@
99 ##############################################################################
100
101 from report import report_sxw
102-from tools import amount_to_text_en
103+from tools import amount_to_text
104
105 class payslip_details_report(report_sxw.rml_parse):
106
107
108=== modified file 'l10n_in_hr_payroll/report/report_payroll_advice.py'
109--- l10n_in_hr_payroll/report/report_payroll_advice.py 2012-07-13 06:38:31 +0000
110+++ l10n_in_hr_payroll/report/report_payroll_advice.py 2012-12-04 16:37:27 +0000
111@@ -25,7 +25,7 @@
112 from datetime import datetime
113
114 from report import report_sxw
115-from tools import amount_to_text_en
116+from tools import amount_to_text
117
118 class payroll_advice_report(report_sxw.rml_parse):
119
120@@ -56,7 +56,7 @@
121 return res
122
123 def convert(self, amount, cur):
124- return amount_to_text_en.amount_to_text(amount, 'en', cur);
125+ return amount_to_text.amount_to_text(amount, 'en', cur);
126
127 def get_bysal_total(self):
128 return self.total_bysal

Subscribers

People subscribed via source and target branches

to all changes: