Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_in: link fatturapa.attachments tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micheledic authored and toita86 committed Nov 27, 2024
1 parent 4c89bc3 commit 5fd7237
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 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 @@ -1199,6 +1199,34 @@ def test_access_other_user_e_invoice(self):
e_invoice = invoices.fatturapa_attachment_in_id
self.assertTrue(e_invoice.ir_attachment_id.read())

def test_access_other_user_e_invoice_attachments(self):
"""A user can see the e-invoice attachments created by other users."""
# Arrange
access_right_group_xmlid = "base.group_erp_manager"
user = self.env.user
user.groups_id -= self.env.ref("base.group_system")
user.groups_id -= self.env.ref(access_right_group_xmlid)
other_user = self.env["res.users"].create(
{
"name": "Attachment User",
"login": "attachment_user",
"groups_id": [(6, 0, user.groups_id.ids)],
}
)
# pre-condition
self.assertFalse(user.has_group(access_right_group_xmlid))
self.assertNotEqual(user, other_user)
import_action = self.run_wizard(
"access_other_user_e_invoice_attachments", "IT02780790107_11004.xml"
)
# Assert
with self.with_user(other_user.login):
invoices = self.env[import_action["res_model"]].search(
import_action["domain"]
)
e_invoice = invoices.fatturapa_doc_attachments
self.assertTrue(e_invoice.ir_attachment_id.read())


class TestFatturaPAEnasarco(FatturapaCommon):
def setUp(self):
Expand Down

0 comments on commit 5fd7237

Please sign in to comment.