-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] account_invoice_facturx_py3o to v16
- Loading branch information
1 parent
58e0c57
commit 74ac350
Showing
4 changed files
with
14 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Copyright 2017-2021 Akretion France (http://www.akretion.com/) | ||
# Copyright 2017-2022 Akretion France (http://www.akretion.com/) | ||
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Py3o Factur-x Invoice", | ||
"version": "14.0.1.0.0", | ||
"version": "16.0.1.0.0", | ||
"category": "Invoicing Management", | ||
"license": "AGPL-3", | ||
"summary": "Generate Factur-X invoices with Py3o reporting engine", | ||
"author": "Akretion,Odoo Community Association (OCA)", | ||
"maintainers": ["alexis-via"], | ||
"website": "https://github.com/OCA/edi", | ||
"depends": ["account_invoice_facturx", "report_py3o"], | ||
"external_dependencies": {"python": ["factur-x"]}, | ||
"installable": True, | ||
"auto_install": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
# Copyright 2017-2021 Akretion France (http://www.akretion.com/) | ||
# Copyright 2017-2022 Akretion France (http://www.akretion.com/) | ||
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
import logging | ||
|
||
from odoo import models | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
try: | ||
from facturx import generate_facturx_from_file | ||
except ImportError: | ||
logger.debug("Cannot import facturx") | ||
|
||
|
||
class Py3oReport(models.TransientModel): | ||
_inherit = "py3o.report" | ||
|
@@ -28,16 +19,8 @@ def _postprocess_report(self, model_instance, result_path): | |
and self.ir_actions_report_id.py3o_filetype == "pdf" | ||
and result_path | ||
): | ||
invoice = model_instance | ||
move = model_instance | ||
# re-write PDF on result_path | ||
if invoice._xml_format_in_pdf_invoice() == "factur-x": | ||
facturx_xml_str, level = invoice.generate_facturx_xml() | ||
pdf_metadata = invoice._prepare_pdf_metadata() | ||
generate_facturx_from_file( | ||
result_path, | ||
facturx_xml_str, | ||
check_xsd=False, | ||
facturx_level=level, | ||
pdf_metadata=pdf_metadata, | ||
) | ||
if move._xml_format_in_pdf_invoice() == "factur-x": | ||
move.regular_pdf_invoice_to_facturx_invoice(result_path) | ||
return super()._postprocess_report(model_instance, result_path) | ||
1 change: 1 addition & 0 deletions
1
setup/account_invoice_facturx_py3o/odoo/addons/account_invoice_facturx_py3o
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../account_invoice_facturx_py3o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |