Skip to content

Commit

Permalink
Merge PR OCA#3481 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 19, 2024
2 parents 44dfb4c + 5748ba6 commit bb10825
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions l10n_es_intrastat_report/tests/test_l10n_es_intrastat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from datetime import datetime

from psycopg2.errors import NotNullViolation

from odoo import _
from odoo.tests import tagged
from odoo.tests.common import Form
Expand Down Expand Up @@ -186,7 +184,8 @@ def test_report_creation_dispatches(self):
self.invoices["dispatches"]["invoices"],
report_dispatches.computation_line_ids,
)
report_dispatches.done()
report_dispatches.draft2confirmed()
report_dispatches.confirmed2done()
self.assertEqual(report_dispatches.state, "done")
self.assertEqual(
len(report_dispatches.declaration_line_ids), 2
Expand Down Expand Up @@ -221,15 +220,13 @@ def test_report_creation_dispatches_notes_and_lines(self):
report_dispatches.action_gather()
for expected_note in expected_notes:
self.assertIn(expected_note, report_dispatches.note)
with self.assertRaises(NotNullViolation):
report_dispatches.done()
self.assertEqual(len(report_dispatches.declaration_line_ids), 0)
# # Change data to remove some notes and create lines
self.product.origin_country_id = self.env.ref("base.fr")
self.partner_1.vat = "FR23334175221"
self.partner_2.vat = "FR23334175221"
report_dispatches.action_gather()
report_dispatches.done()
report_dispatches.draft2confirmed()
report_dispatches.confirmed2done()
self.assertEqual(report_dispatches.state, "done")
self.assertEqual(
len(report_dispatches.declaration_line_ids), len(expected_invoices) / 2
Expand All @@ -244,7 +241,8 @@ def test_report_creation_arrivals(self):
self._check_move_lines_present(
self.invoices["arrivals"]["invoices"], report_arrivals.computation_line_ids
)
report_arrivals.done()
report_arrivals.draft2confirmed()
report_arrivals.confirmed2done()
self.assertEqual(report_arrivals.state, "done")
self.assertEqual(
len(report_arrivals.declaration_line_ids), 2
Expand Down

0 comments on commit bb10825

Please sign in to comment.