[FIX] l10n_be: fix error if the main company doesn't have a vat number

bzr revid: qdp-launchpad@openerp.com-20111201153535-vdcocilw10zuiu8f
This commit is contained in:
Quentin (OpenERP) 2011-12-01 16:35:35 +01:00
parent ae9c126ab5
commit 14d5e1df2d
1 changed files with 2 additions and 1 deletions

View File

@ -70,9 +70,10 @@ class l10n_be_vat_declaration(osv.osv_memory):
obj_company = data_tax.tax_code_id.company_id
else:
obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
vat_no = obj_company.partner_id.vat.replace(' ','').upper()
vat_no = obj_company.partner_id.vat
if not vat_no:
raise osv.except_osv(_('Data Insufficient'), _('No VAT Number Associated with Main Company!'))
vat_no = vat_no.replace(' ','').upper()
tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
ctx = context.copy()