Commit 1f8df61e authored by agb80's avatar agb80

Fix Fiscal Regimen validation when generating and invoice

At commit d8242f34 the validation for fiscal regimen data on company
were incorrect idented causing an invoice without fiscal regimen
gets into the PAC signing process generating a "Invalid XML" error.
parent b804a45c
......@@ -343,7 +343,7 @@ class account_invoice(osv.Model):
'no_certificado': False,
'certificado': False,
'sello': False,
'cadena_original': False,
'cadena_original': False,
'cfdi_cbb': False,
'cfdi_sello': False,
'cfdi_no_certificado': False,
......@@ -408,7 +408,7 @@ class account_invoice(osv.Model):
key_node.appendChild(text_node)
new_node.appendChild(key_node)
parent_node.appendChild(new_node)
return new_node
return new_node
def _get_type_sequence(self, cr, uid, ids, context=None):
if context is None:
......@@ -421,7 +421,7 @@ class account_invoice(osv.Model):
if sequence_app_id:
type_inv = ir_seq_app_obj.browse(
cr, uid, sequence_app_id[0], context=context).type
if 'cfdi32' in type_inv: # Revisa si en tipo es cfdi
if 'cfdi32' in type_inv: # Revisa si en tipo es cfdi
comprobante = 'cfdi:Comprobante'
else:
comprobante = 'Comprobante'
......@@ -1287,12 +1287,12 @@ class account_invoice(osv.Model):
'voucher is complete (City - State - Country)')
)
if not invoice.company_id.partner_id.regimen_fiscal_id.name:
raise osv.except_osv(
_('Missing Fiscal Regime!'),
_('The Fiscal Regime of the company issuing of fiscal '
'voucher is a data required')
)
if not invoice.company_id.partner_id.regimen_fiscal_id.name:
raise osv.except_osv(
_('Missing Fiscal Regime!'),
_('The Fiscal Regime of the company issuing invoice '
'is required')
)
invoice_data_parents[0]['Comprobante'][
'xsi:schemaLocation'] = 'http://www.sat.gob.mx/cfd/2 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv22.xsd'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment