Skip to content

Commit

Permalink
Merge PR OCA#4133 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by sergiocorato
  • Loading branch information
OCA-git-bot committed Aug 7, 2024
2 parents 0f05d07 + a8efa73 commit 1fd9dd4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion l10n_it_fatturapa/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def _compute_ftpa_preview_link(self):
att.get_base_url() + "/fatturapa/preview/%s" % att.ir_attachment_id.id
)

@staticmethod
def ftpa_preview(self):
return {
"type": "ir.actions.act_url",
Expand Down
9 changes: 9 additions & 0 deletions l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,15 @@ def test_02_xml_link(self):
# allow following tests to reuse the same XML file
orig_invoice.ref = orig_invoice.payment_reference = "14021"

def test_01_xml_preview(self):
res = self.run_wizard("test_preview", "IT05979361218_001.xml")
invoice_id = res.get("domain")[0][2][0]
invoice = self.invoice_model.browse(invoice_id)
preview_action = invoice.fatturapa_attachment_in_id.ftpa_preview()
self.assertEqual(
preview_action["url"], invoice.fatturapa_attachment_in_id.ftpa_preview_link
)

def test_01_xml_zero_quantity_line(self):
res = self.run_wizard("test_zeroq_01", "IT05979361218_q0.xml")
invoice_id = res.get("domain")[0][2][0]
Expand Down
5 changes: 5 additions & 0 deletions l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,11 @@ def test_reset_to_ready(self):
e_invoice.reset_to_ready()
self.assertEqual(e_invoice.state, "ready")

def test_preview(self):
e_invoice = self._create_e_invoice()
preview_action = e_invoice.ftpa_preview()
self.assertEqual(preview_action["url"], e_invoice.ftpa_preview_link)

def test_no_export_bill(self):
invoice = self.invoice_model.create(
{
Expand Down

0 comments on commit 1fd9dd4

Please sign in to comment.