Merge lp:~openerp-dev/openobject-addons/6.1-opw-576266-dhs into lp:openobject-addons/6.1

Proposed by Dhruti Shastri(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6895
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576266-dhs
Merge into: lp:openobject-addons/6.1
Diff against target: 55 lines (+12/-6)
1 file modified
l10n_be/wizard/l10n_be_partner_vat_listing.py (+12/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-576266-dhs
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+115536@code.launchpad.net

Description of the change

To reproduce the issue install Account and l10n_be module

After Installed Module go to : Accounting/Reporting/Legal
Reports/Belgium Statements/Annual Listing Of VAT-Subjected
Customers.

Open "Annual Listing Of VAT-Subjected Customers" wizard and
click on "Create XML" OR "Print" Button it is giving following
trace back.

When no phone is defined in the company and in Partner.
"/home/vpa/workspace/6.1/addons-6.1/l10n_be/wizard/l10n_be_partner_vat_listing.py",
line 190, in create_xml
phone = ads.phone.replace(' ','') or ''
AttributeError: 'bool' object has no attribute 'replace'

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Already Fixed on Trunk (means that it was already fixed and merged in Trunk). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6895. By Dhruti Shastri(OpenERP)

[l10_be] : Wizard thorws error instead of User Friendly Warning (Case:576266)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'l10n_be/wizard/l10n_be_partner_vat_listing.py'
--- l10n_be/wizard/l10n_be_partner_vat_listing.py 2012-02-15 13:18:16 +0000
+++ l10n_be/wizard/l10n_be_partner_vat_listing.py 2012-07-18 11:59:30 +0000
@@ -65,6 +65,8 @@
6565
66 partners = []66 partners = []
67 partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)67 partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)
68 if not partner_ids:
69 raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation'))
68 cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount70 cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount
69 FROM (SELECT l.partner_id, p.name, p.vat, SUM(CASE WHEN c.code ='49' THEN -l.tax_amount ELSE l.tax_amount END) as turnover71 FROM (SELECT l.partner_id, p.name, p.vat, SUM(CASE WHEN c.code ='49' THEN -l.tax_amount ELSE l.tax_amount END) as turnover
70 FROM account_move_line l72 FROM account_move_line l
@@ -188,7 +190,7 @@
188 addr = obj_partner.address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice'])190 addr = obj_partner.address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice'])
189 if addr.get('invoice',False):191 if addr.get('invoice',False):
190 ads = obj_addr.browse(cr, uid, [addr['invoice']], context=context)[0]192 ads = obj_addr.browse(cr, uid, [addr['invoice']], context=context)[0]
191 phone = ads.phone.replace(' ','') or ''193 phone = ads.phone.replace(' ','') if ads.phone else ''
192 email = ads.email or ''194 email = ads.email or ''
193 name = ads.name or ''195 name = ads.name or ''
194 city = obj_addr.get_city(cr, uid, ads.id)196 city = obj_addr.get_city(cr, uid, ads.id)
@@ -246,17 +248,19 @@
246 <VATNumber>%(SenderId)s</VATNumber>248 <VATNumber>%(SenderId)s</VATNumber>
247 <Name>%(comp_name)s</Name>249 <Name>%(comp_name)s</Name>
248 <Street>%(street)s</Street>250 <Street>%(street)s</Street>
249 <PostCode>%(zip)s</PostCode> 251 <PostCode>%(zip)s</PostCode>
250 <City>%(city)s</City> 252 <City>%(city)s</City>
251 <CountryCode>%(country)s</CountryCode> 253 <CountryCode>%(country)s</CountryCode>
252 <EmailAddress>%(email)s</EmailAddress> 254 <EmailAddress>%(email)s</EmailAddress>
253 <Phone>%(phone)s</Phone> 255 <Phone>%(phone)s</Phone>
254 </ns2:Declarant>256 </ns2:Declarant>
255 <ns2:Period>%(period)s</ns2:Period>257 <ns2:Period>%(period)s</ns2:Period>
256 """ % annual_listing_data258 """ % annual_listing_data
257259
258 # Turnover and Farmer tags are not included260 # Turnover and Farmer tags are not included
259 client_datas = self._get_datas(cr, uid, ids, context=context)261 client_datas = self._get_datas(cr, uid, ids, context=context)
262 if not client_datas:
263 raise osv.except_osv(_('Data Insufficient!'),_('No data available for the client.'))
260 data_client_info = ''264 data_client_info = ''
261 for amount_data in client_datas:265 for amount_data in client_datas:
262 data_client_info += """266 data_client_info += """
@@ -307,6 +311,8 @@
307 datas['year'] = context['year']311 datas['year'] = context['year']
308 datas['limit_amount'] = context['limit_amount']312 datas['limit_amount'] = context['limit_amount']
309 datas['client_datas'] = self._get_datas(cr, uid, ids, context=context)313 datas['client_datas'] = self._get_datas(cr, uid, ids, context=context)
314 if not datas['client_datas']:
315 raise osv.except_osv(_('Error !'),_('No record to print.'))
310 return {316 return {
311 'type': 'ir.actions.report.xml',317 'type': 'ir.actions.report.xml',
312 'report_name': 'partner.vat.listing.print',318 'report_name': 'partner.vat.listing.print',