Fix bug in field type

This commit is contained in:
Bernat Brunet Torruella 2018-10-19 09:57:07 +02:00
parent 32a1a5409b
commit d1c3ec3bcb

10
aeat.py
View file

@ -591,7 +591,8 @@ class SIIReport(Workflow, ModelSQL, ModelView):
lines_to_create = []
for reg in registers:
taxes_to_create = []
taxes = exemption = None
taxes = None
exemption = ''
tipo_desglose = reg.DatosFacturaEmitida.TipoDesglose
if tipo_desglose.DesgloseFactura:
sujeta = tipo_desglose.DesgloseFactura.Sujeta
@ -626,7 +627,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
'invoice': invoices_ids.get(
reg.IDFactura.NumSerieFacturaEmisor),
'state': reg.EstadoFactura.EstadoRegistro,
'last_modify_date': _datetime(
'last_modify_date': _date(
reg.EstadoFactura.TimestampUltimaModificacion),
'communication_code': reg.EstadoFactura.CodigoErrorRegistro,
'communication_msg': reg.EstadoFactura.DescripcionErrorRegistro,
@ -775,7 +776,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
sii_report_line = {
'report': self.id,
'state': reg.EstadoFactura.EstadoRegistro,
'last_modify_date': _datetime(
'last_modify_date': _date(
reg.EstadoFactura.TimestampUltimaModificacion),
'communication_code': (
reg.EstadoFactura.CodigoErrorRegistro),
@ -861,7 +862,7 @@ class SIIReportLine(ModelSQL, ModelView):
'operation_type') != 'C0',
})
state = fields.Selection(AEAT_INVOICE_STATE, 'State')
last_modify_date = fields.Char('Last Modification Date', readonly=True)
last_modify_date = fields.Date('Last Modification Date', readonly=True)
communication_code = fields.Integer(
'Communication Code', readonly=True)
communication_msg = fields.Char(
@ -892,6 +893,7 @@ class SIIReportLine(ModelSQL, ModelView):
fields.Selection(OPERATION_KEY, 'SII Operation Key'),
'get_invoice_operation_key')
exemption_key = fields.Char('Exemption Cause', readonly=True)
aeat_register = fields.Text('Register from AEAT Webservice', readonly=True)
def get_invoice_operation_key(self, name):
return self.invoice.sii_operation_key if self.invoice else None