diff --git a/l10n_it_fatturapa/README.rst b/l10n_it_fatturapa/README.rst index cb1993a0f514..600b3bab8641 100644 --- a/l10n_it_fatturapa/README.rst +++ b/l10n_it_fatturapa/README.rst @@ -170,6 +170,10 @@ Contributors - Simone Rubino +- `Stesi Consulting Srl `__: + + - Michele Di Croce + Maintainers ----------- diff --git a/l10n_it_fatturapa/__manifest__.py b/l10n_it_fatturapa/__manifest__.py index 41f1267fb092..dc4ac0a57e48 100644 --- a/l10n_it_fatturapa/__manifest__.py +++ b/l10n_it_fatturapa/__manifest__.py @@ -6,7 +6,7 @@ { "name": "ITA - Fattura elettronica - Base", - "version": "16.0.1.1.0", + "version": "16.0.1.1.1", "category": "Localization/Italy", "summary": "Fatture elettroniche", "author": "Davide Corio, Agile Business Group, Innoviu, " diff --git a/l10n_it_fatturapa/migrations/16.0.1.1.1/post-migrate.py b/l10n_it_fatturapa/migrations/16.0.1.1.1/post-migrate.py new file mode 100644 index 000000000000..cd13d9c9213c --- /dev/null +++ b/l10n_it_fatturapa/migrations/16.0.1.1.1/post-migrate.py @@ -0,0 +1,10 @@ +# Copyright 2024 Michele Di Croce - Stesi Consulting srl +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + fatturapa_attachments = env["fatturapa.attachments"].search([]) + fatturapa_attachments._l10n_it_link_attachments() diff --git a/l10n_it_fatturapa/models/__init__.py b/l10n_it_fatturapa/models/__init__.py index 906221fe7b29..cda1840d7f54 100644 --- a/l10n_it_fatturapa/models/__init__.py +++ b/l10n_it_fatturapa/models/__init__.py @@ -1,7 +1,7 @@ # Copyright 2014 Davide Corio +from . import link_e_invoice_ir_attachment from . import account from . import company from . import partner from . import ir_attachment -from . import link_e_invoice_ir_attachment diff --git a/l10n_it_fatturapa/models/account.py b/l10n_it_fatturapa/models/account.py index 81ca1d30d114..77d13a7f1681 100644 --- a/l10n_it_fatturapa/models/account.py +++ b/l10n_it_fatturapa/models/account.py @@ -217,6 +217,7 @@ class FatturaAttachments(models.Model): _name = "fatturapa.attachments" _description = "E-invoice attachments" _inherits = {"ir.attachment": "ir_attachment_id"} + _inherit = ["l10n_it_fatturapa.attachment.e_invoice.link"] ir_attachment_id = fields.Many2one( "ir.attachment", "Attachment", required=True, ondelete="cascade" diff --git a/l10n_it_fatturapa/readme/CONTRIBUTORS.md b/l10n_it_fatturapa/readme/CONTRIBUTORS.md index 19f4eb1c7da9..c8177f2029b9 100644 --- a/l10n_it_fatturapa/readme/CONTRIBUTORS.md +++ b/l10n_it_fatturapa/readme/CONTRIBUTORS.md @@ -19,3 +19,5 @@ > - Giovanni Serra \<\> - [Aion Tech](https://aiontech.company/): - Simone Rubino \<\> +- [Stesi Consulting](https://www.stesi.consulting): + - Michele Di Croce \<\> diff --git a/l10n_it_fatturapa/static/description/index.html b/l10n_it_fatturapa/static/description/index.html index 164dd40894c4..6d2bc3526588 100644 --- a/l10n_it_fatturapa/static/description/index.html +++ b/l10n_it_fatturapa/static/description/index.html @@ -509,6 +509,11 @@

Contributors

  • Simone Rubino <simone.rubino@aion-tech.it>
  • +
  • Stesi Consulting:

    + +
  • diff --git a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py index 6ea08b013e8a..971a34593c27 100644 --- a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py +++ b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py @@ -1134,6 +1134,28 @@ 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 = user.copy(default={"login": "attachment_user"}) + # 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):