Merge lp:~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing into lp:openerp-canada/6.1

Proposed by Joao Alfredo Gama Batista
Status: Merged
Merged at revision: 9
Proposed branch: lp:~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing
Merge into: lp:openerp-canada/6.1
Diff against target: 70 lines (+27/-4)
2 files modified
l10n_ca_account_check_writing/report/l10n_ca_check_print.py (+22/-2)
l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml (+5/-2)
To merge this branch: bzr merge lp:~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) lgtm, no test. Approve
Review via email: mp+161032@code.launchpad.net

Description of the change

- Fixed address issue

To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (lgtm, no test.)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print.py'
2--- l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2013-04-25 21:02:28 +0000
3+++ l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2013-04-25 22:25:30 +0000
4@@ -32,12 +32,13 @@
5 self.localcontext.update({
6 'time': time,
7 'get_lines': self.get_lines,
8+ 'get_zip_line': self.get_zip_line,
9 'fill_stars' : self.fill_stars,
10 })
11 def fill_stars(self, amount):
12 amount = amount.replace('Dollars','')
13- if len(amount) < 100:
14- stars = 100 - len(amount)
15+ if len(amount) < 90:
16+ stars = 90 - len(amount)
17 return ' '.join([amount,'*'*stars])
18
19 else: return amount
20@@ -65,6 +66,25 @@
21 result.append(res)
22 return result
23
24+ def get_zip_line(self, address):
25+ '''
26+ Get the address line
27+ '''
28+ ret = ''
29+ if address:
30+ if address.city:
31+ ret += address.city
32+ if address.state_id:
33+ if address.state_id.name:
34+ if ret:
35+ ret += ', '
36+ ret += address.state_id.name
37+ if address.zip:
38+ if ret:
39+ ret += ' '
40+ ret += address.zip
41+ return ret
42+
43 report_sxw.report_sxw(
44 'report.l10n.ca.account.print.check.top',
45 'account.voucher',
46
47=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml'
48--- l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml 2013-04-25 21:02:28 +0000
49+++ l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml 2013-04-25 22:25:30 +0000
50@@ -203,7 +203,7 @@
51 </tr>
52 </blockTable>
53
54- <blockTable colWidths="30.0,538.0" rowHeights="15.0" style="Table5">
55+ <blockTable colWidths="30.0,528.0" rowHeights="15.0" style="Table5">
56 <tr>
57 <td>
58 <para style="P3"><font color="white"> </font></para>
59@@ -235,7 +235,10 @@
60 </td>
61 <td>
62 <para style="P15">[[ voucher.partner_id.name ]]</para>
63- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
64+ <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para>
65+ <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para>
66+ <para style="P15">[[ get_zip_line(voucher.partner_id.address[0]) ]] </para>
67+ <para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para>
68 </td>
69 <td>
70 <para style="P3"><font color="white"> </font></para>

Subscribers

People subscribed via source and target branches