diff --git a/models/ws_caea_code.py b/models/ws_caea_code.py index 3c1013147aa1b25f9a9421c43d68a7e4f5cd38e5..fb87f6e19d1d588a31395fb7767191a5048e72dd 100644 --- a/models/ws_caea_code.py +++ b/models/ws_caea_code.py @@ -313,8 +313,7 @@ class WsCaeaCode(models.Model): env_curr_caea = self.env['caea.currency.codes'] code_curr = env_curr_caea.get_cod(invoice.currency_id) - now = datetime.now() - now_string = "%s-%s-%s" % (now.strftime("%Y"), now.strftime("%m"), now.strftime("%d")) + exit_date = invoice.date_invoice.strftime('%Y-%m-%d') voucher_type = invoice._get_voucher_type() next_number = self.get_next_caea_voucher_number(invoice=invoice) # Save voucher number @@ -325,7 +324,7 @@ class WsCaeaCode(models.Model): 'codigoTipoComprobante': voucher_type, 'numeroPuntoVenta': int(invoice.pos_ar_id.name), 'numeroComprobante': next_number, - 'fechaEmision': now_string, + 'fechaEmision': exit_date, 'codigoTipoAutorizacion': 'A', 'codigoAutorizacion': int(invoice.caea), 'fechaVencimiento': str(invoice.date_to),