Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-574929-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-574929-port-mma/+merge/132323

Hello,

"[FIX] Error while opening the Annual Listing Of VAT-Subjected Customers wizard 
due to no customers while fetching data"

Steps:
1). Install l10n_be module
2). Goto : Accounting/Reporting/Legal Reports/Belgium Statements
3). Open wizard "Annual Listing Of VAT-Subjected Customers" Without 
configuration of VAT number in customers

This branch fixes this issue.
Code is forward port from 6.1

Thanks
Mayur
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-574929-port-mma/+merge/132323
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-574929-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-10-31 13:17:21 +0000
@@ -65,6 +65,9 @@
 
         partners = []
         partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)
+        if not partner_ids:
+            raise osv.except_osv(_('Data Insufficient!'), _('No partner has a VAT Number associated with him.'))
+
         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

_______________________________________________
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

Reply via email to