[FIX] l10n_it_edi: fix test_ir_mail_server (test_receive_signed_invoice_bill)
closes odoo/odoo#72147 X-original-commit: 3370bb9bf77e76dad4fd72fe7eda3820a3849f5e Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
@@ -288,7 +288,7 @@ class AccountEdiFormat(models.Model):
|
||||
if elements:
|
||||
date_str = elements[0].text
|
||||
date_obj = datetime.strptime(date_str, DEFAULT_FACTUR_ITALIAN_DATE_FORMAT)
|
||||
invoice_form.invoice_date = date_obj.strftime(DEFAULT_FACTUR_ITALIAN_DATE_FORMAT)
|
||||
invoice_form.invoice_date = date_obj
|
||||
|
||||
# Dati Bollo. <2.1.1.6>
|
||||
elements = body_tree.xpath('.//DatiGeneraliDocumento/DatiBollo/ImportoBollo')
|
||||
|
||||
@@ -5,6 +5,7 @@ import datetime
|
||||
import logging
|
||||
from collections import namedtuple
|
||||
from unittest.mock import patch
|
||||
import freezegun
|
||||
|
||||
from odoo import tools
|
||||
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
|
||||
@@ -108,13 +109,14 @@ class PecMailServerTests(AccountEdiTestCommon):
|
||||
|
||||
def test_receive_signed_vendor_bill(self):
|
||||
""" Test a signed (P7M) sample e-invoice file from https://www.fatturapa.gov.it/export/documenti/fatturapa/v1.2/IT01234567890_FPR01.xml """
|
||||
invoices = self._create_invoice(self.signed_invoice_content, self.signed_invoice_filename)
|
||||
self.assertRecordValues(invoices, [{
|
||||
'company_id': self.company.id,
|
||||
'name': 'BILL/2014/12/0001',
|
||||
'date': datetime.date(2014, 12, 18),
|
||||
'ref': '01234567890',
|
||||
}])
|
||||
with freezegun.freeze_time('2020-04-06'):
|
||||
invoices = self._create_invoice(self.signed_invoice_content, self.signed_invoice_filename)
|
||||
self.assertRecordValues(invoices, [{
|
||||
'company_id': self.company.id,
|
||||
'name': 'BILL/2020/04/0001',
|
||||
'invoice_date': datetime.date(2014, 12, 18),
|
||||
'ref': '01234567890',
|
||||
}])
|
||||
|
||||
def test_receive_same_vendor_bill_twice(self):
|
||||
""" Test that the second time we are receiving a PEC mail with the same attachment, the second is discarded """
|
||||
|
||||
Reference in New Issue
Block a user