openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #05524
[Merge] lp:~openerp-community/openerp-canada/7.0-l10n_ca_account_check_writing into lp:openerp-canada
Vincent Vinet has proposed merging lp:~openerp-community/openerp-canada/7.0-l10n_ca_account_check_writing into lp:openerp-canada.
Requested reviews:
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903)
For more details, see:
https://code.launchpad.net/~openerp-community/openerp-canada/7.0-l10n_ca_account_check_writing/+merge/216708
Modify the l10n_ca_account_check_writing module pdf reports to also
show credit lines for a voucher.
Also fix a str being used instead of unicode to format data from a model, which
caused errors with accents in account lines.
--
https://code.launchpad.net/~openerp-community/openerp-canada/7.0-l10n_ca_account_check_writing/+merge/216708
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openerp-canada/7.0-l10n_ca_account_check_writing.
=== modified file 'l10n_ca_account_check_writing/account_voucher.py'
--- l10n_ca_account_check_writing/account_voucher.py 2014-02-26 17:01:40 +0000
+++ l10n_ca_account_check_writing/account_voucher.py 2014-04-22 13:06:32 +0000
@@ -54,9 +54,9 @@
else:
stars = ''
AND = custom_translation("and", lang)
- amount_line_fmt = '{amount_in_word} {AND} {cents}/100 {currency_name} {stars}'
+ amount_line_fmt = u'{amount_in_word} {AND} {cents}/100 {currency_name} {stars}'
if lang.startswith('fr'):
- amount_line_fmt = '{amount_in_word} {currency_name} {AND} {cents}/100 {stars}'
+ amount_line_fmt = u'{amount_in_word} {currency_name} {AND} {cents}/100 {stars}'
return amount_line_fmt.format(**vars())
=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print.py'
--- l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2013-06-14 16:03:18 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2014-04-22 13:06:32 +0000
@@ -21,7 +21,7 @@
import time
from openerp.report import report_sxw
-from openerp.tools import amount_to_text_en
+
class report_print_check(report_sxw.rml_parse):
@@ -31,9 +31,14 @@
self.number_add = 0
self.localcontext.update({
'time': time,
- 'get_lines': self.get_lines,
+ 'get_all_lines': self.get_all_lines,
})
-
+
+ def get_all_lines(self, voucher):
+ debit_lines = voucher.line_dr_ids
+ credit_lines = voucher.line_cr_ids
+ return self.get_lines(debit_lines + credit_lines)
+
def get_lines(self, voucher_lines):
result = []
self.number_lines = len(voucher_lines)
=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml'
--- l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml 2013-06-18 17:43:52 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml 2014-04-22 13:06:32 +0000
@@ -144,7 +144,7 @@
</tr>
<tr>
<td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
+ <para style="P19">[[ repeatIn(get_all_lines(voucher),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
</td>
<td>
<para style="P19">[[ l['name'] ]]</para>
@@ -299,7 +299,7 @@
</tr>
<tr>
<td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
+ <para style="P19">[[ repeatIn(get_all_lines(voucher),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
</td>
<td>
<para style="P19">[[ l['name'] ]]</para>
=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print_top.rml'
--- l10n_ca_account_check_writing/report/l10n_ca_check_print_top.rml 2013-06-18 17:43:52 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print_top.rml 2014-04-22 13:06:32 +0000
@@ -220,7 +220,7 @@
</tr>
<tr>
<td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
+ <para style="P19">[[ repeatIn(get_all_lines(voucher),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
</td>
<td>
<para style="P19">[[ l['name'] ]]</para>
@@ -293,7 +293,7 @@
</tr>
<tr>
<td>
- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
+ <para style="P19">[[ repeatIn(get_all_lines(voucher),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
</td>
<td>
<para style="P19">[[ l['name'] ]]</para>
References