Skip to content

Commit

Permalink
Merge PR #4250 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by SirAionTech
  • Loading branch information
OCA-git-bot committed Jul 18, 2024
2 parents 77b0ae5 + cbf7cf1 commit 88374b5
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 2 deletions.
4 changes: 4 additions & 0 deletions l10n_it_fatturapa/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ Contributors

- Simone Rubino <[email protected]>

- `Stesi Consulting Srl <https://www.stesi.consulting/>`__:

- Michele Di Croce <[email protected]>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion l10n_it_fatturapa/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
10 changes: 10 additions & 0 deletions l10n_it_fatturapa/migrations/16.0.1.1.1/post-migrate.py
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion l10n_it_fatturapa/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2014 Davide Corio <[email protected]>

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
1 change: 1 addition & 0 deletions l10n_it_fatturapa/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions l10n_it_fatturapa/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
> - Giovanni Serra \<<[email protected]>\>
- [Aion Tech](https://aiontech.company/):
- Simone Rubino \<<[email protected]>\>
- [Stesi Consulting](https://www.stesi.consulting):
- Michele Di Croce \<<[email protected]>\>
5 changes: 5 additions & 0 deletions l10n_it_fatturapa/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;aion-tech.it">simone.rubino&#64;aion-tech.it</a>&gt;</li>
</ul>
</li>
<li><p class="first"><a class="reference external" href="https://www.stesi.consulting">Stesi Consulting</a>:</p>
<ul class="simple">
<li>Michele Di Croce &lt;<a class="reference external" href="mailto:dicroce.m&#64;stesi.consulting">dicroce.m&#64;stesi.consulting</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
22 changes: 22 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 @@ -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):
Expand Down

0 comments on commit 88374b5

Please sign in to comment.