Mayur Maheshwari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-opw-576266-port-mma into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576266-port-mma/+merge/132839
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.
ProgrammingError: syntax error at or near ")"
When no phone is defined in the company and in Partner.
AttributeError: 'bool' object has no attribute 'replace'
Code is forward port from 6.1
Thanks,
Mayur
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576266-port-mma/+merge/132839
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-opw-576266-port-mma.
=== modified file 'l10n_be/wizard/l10n_be_partner_vat_listing.py'
--- l10n_be/wizard/l10n_be_partner_vat_listing.py 2012-10-25 13:09:30 +0000
+++ l10n_be/wizard/l10n_be_partner_vat_listing.py 2012-11-05 06:26:21 +0000
@@ -65,6 +65,8 @@
partners = []
partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)
+ if not partner_ids:
+ raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation'))
cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount
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
FROM account_move_line l
@@ -190,7 +192,7 @@
addr = obj_partner.address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice'])
if addr.get('invoice',False):
ads = obj_partner.browse(cr, uid, [addr['invoice']], context=context)[0]
- phone = ads.phone.replace(' ','') or ''
+ phone = ads.phone.replace(' ','') if ads.phone else ''
email = ads.email or ''
name = ads.name or ''
city = ads.city or ''
@@ -259,6 +261,8 @@
# Turnover and Farmer tags are not included
client_datas = self._get_datas(cr, uid, ids, context=context)
+ if not client_datas:
+ raise osv.except_osv(_('Data Insufficient!'),_('No data available for the client.'))
data_client_info = ''
for amount_data in client_datas:
data_client_info += """
@@ -309,6 +313,8 @@
datas['year'] = context['year']
datas['limit_amount'] = context['limit_amount']
datas['client_datas'] = self._get_datas(cr, uid, ids, context=context)
+ if not datas['client_datas']:
+ raise osv.except_osv(_('Error !'),_('No record to print.'))
return {
'type': 'ir.actions.report.xml',
'report_name': 'partner.vat.listing.print',
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp