← Back to team overview

openerp-community team mailing list archive

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

 

Joao Alfredo Gama Batista has proposed merging lp:~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing into lp:openerp-canada/6.1.

Requested reviews:
  Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903)

For more details, see:
https://code.launchpad.net/~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing/+merge/161032

- Fixed address issue
-- 
https://code.launchpad.net/~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing/+merge/161032
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openerp-canada/6.1-l10n_ca_account_check_writing.
=== 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-04-25 21:02:28 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print.py	2013-04-25 22:25:30 +0000
@@ -32,12 +32,13 @@
         self.localcontext.update({
             'time': time,
             'get_lines': self.get_lines,
+            'get_zip_line': self.get_zip_line,
             'fill_stars' : self.fill_stars,
         })
     def fill_stars(self, amount):
         amount = amount.replace('Dollars','')
-        if len(amount) < 100:
-            stars = 100 - len(amount)
+        if len(amount) < 90:
+            stars = 90 - len(amount)
             return ' '.join([amount,'*'*stars])
 
         else: return amount
@@ -65,6 +66,25 @@
             result.append(res)
         return result
 
+    def get_zip_line(self, address):
+        '''
+        Get the address line
+        '''
+        ret = ''
+        if address:
+            if address.city:
+                ret += address.city
+            if address.state_id:
+                if address.state_id.name:
+                    if ret:
+                        ret += ', '
+                    ret += address.state_id.name
+            if address.zip:
+                if ret:
+                    ret += ' '
+                ret += address.zip
+        return ret
+
 report_sxw.report_sxw(
     'report.l10n.ca.account.print.check.top',
     'account.voucher',

=== 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-04-25 21:02:28 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print_middle.rml	2013-04-25 22:25:30 +0000
@@ -203,7 +203,7 @@
 	</tr>
     </blockTable>
 
-    <blockTable colWidths="30.0,538.0" rowHeights="15.0" style="Table5">
+    <blockTable colWidths="30.0,528.0" rowHeights="15.0" style="Table5">
 	<tr>
 	    <td>
                 <para style="P3"><font color="white"> </font></para>
@@ -235,7 +235,10 @@
               </td>
               <td>
                 <para style="P15">[[ voucher.partner_id.name ]]</para>
-                <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
+                <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para>
+                <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para>
+                <para style="P15">[[ get_zip_line(voucher.partner_id.address[0]) ]] </para>
+                <para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para>                
               </td>
 	      <td>
 		  <para style="P3"><font color="white"> </font></para>


Follow ups