Skip to content

Commit

Permalink
[ADD] l10n_it_edi_extension: aggiunta PR OCA#4411
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed Dec 23, 2024
1 parent 187d020 commit eea23f0
Show file tree
Hide file tree
Showing 17 changed files with 3,918 additions and 0 deletions.
88 changes: 88 additions & 0 deletions l10n_it_edi_extension/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
==================================
Italy - E-invoicing - Base Feature
==================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f1248807eff1e257c248a5aa7e2174684c32b780f443ff30730f1f1b1e850bd1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_extension
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_edi_extension
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

**Italiano**

Questo modulo aggiunge funzionalità basi per gestire le fatture
elettroniche.

<https://www.fatturapa.gov.it>

**English**

This module adds base feature to handle e-invoice.

<https://www.fatturapa.gov.it>

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_edi_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Giuseppe Borruso

Contributors
------------

- Giuseppe Borruso - Dinamiche Aziendali srl
<[email protected]>

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_extension>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions l10n_it_edi_extension/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2024 Giuseppe Borruso <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import controllers
from . import models
21 changes: 21 additions & 0 deletions l10n_it_edi_extension/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Giuseppe Borruso <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Italy - E-invoicing - Base Feature",
"version": "18.0.1.0.0",
"category": "Accounting/Localizations/EDI",
"development_status": "Production/Stable",
"summary": "E-invoice base feature",
"author": "Giuseppe Borruso, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-italy",
"license": "AGPL-3",
"depends": [
"l10n_it_edi",
],
"data": [
"data/invoice_it_template.xml",
"views/l10n_it_view.xml",
],
"installable": True,
}
1 change: 1 addition & 0 deletions l10n_it_edi_extension/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import portal
27 changes: 27 additions & 0 deletions l10n_it_edi_extension/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Giuseppe Borruso <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.http import Controller, request, route


class FatturaPAController(Controller):
@route(
[
"/fatturapa/preview/<attachment_id>",
],
type="http",
auth="user",
website=True,
)
def fatturapa_preview(self, attachment_id, **data):
attach = request.env["ir.attachment"].browse(int(attachment_id))
html = attach.get_fattura_elettronica_preview()
if isinstance(html, bytes):
html = html.decode()
pdf = request.env["ir.actions.report"]._run_wkhtmltopdf([html])

pdfhttpheaders = [
("Content-Type", "application/pdf"),
("Content-Length", len(pdf)),
]
return request.make_response(pdf, headers=pdfhttpheaders)
Loading

0 comments on commit eea23f0

Please sign in to comment.