Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-50926-ado into 
lp:openobject-addons/6.0.

Requested reviews:
  Priyesh (OpenERP) (pso-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50926-ado/+merge/84451

Hello,

[FIX] : Problem while creating a new client in Partner VAT listing wizard of 
l10n_be

Thanks,
Amit
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50926-ado/+merge/84451
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-50926-ado.
=== modified file 'l10n_be/wizard/l10_be_partner_vat_listing.py'
--- l10n_be/wizard/l10_be_partner_vat_listing.py	2011-01-14 00:11:01 +0000
+++ l10n_be/wizard/l10_be_partner_vat_listing.py	2011-12-05 10:07:29 +0000
@@ -205,8 +205,23 @@
             seq += 1
             sum_tax += line['amount']
             sum_turnover += line['turnover']
-            data_clientinfo += '\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+line['vat'] +'</VATNum>\n\t\t<Country>' + line['country'] +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(round(line['amount'] * 100))) +'</Amount>\n\t<TurnOver>'+str(int(round(line['turnover'] * 100))) +'</TurnOver>\n</ClientList>'
 
+            if not line['vat']:
+                raise osv.except_osv("Missing VAT", "Partner %s does not have a vat number")
+            if not line['country']:
+                raise osv.except_osv("Missing Country", "Partner %s doest not have a country")
+            data_clientinfo = "".join([
+                data_clientinfo,
+                '<ClientList SequenceNum="',str(seq),'">\n',
+                '\t<CompanyInfo>\n',
+                '\t\t<VATNum>',line['vat'],'</VATNum>\n',
+                '\t\t<Country>',line['country'],'</Country>\n',
+                '\t</CompanyInfo>\n',
+                '\t<Amount>',str(int(round(line['amount'] * 100))),'</Amount>\n',
+                '\t<TurnOver>',str(int(round(line['turnover'] * 100))),'</TurnOver>\n',
+                '</ClientList>\n'
+            ])
+            
         data_decl ='\n<DeclarantList SequenceNum="1" DeclarantNum="'+ dnum + '" ClientNbr="'+ str(seq) +'" TurnOverSum="'+ str(int(round(sum_turnover * 100))) +'" TaxSum="'+ str(int(round(sum_tax * 100))) +'" />'
         data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n</VatList>'
         msg = 'Save the File with '".xml"' extension.'

_______________________________________________
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