Skip to content

Commit

Permalink
[TESTE] TESTE
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Nov 26, 2024
1 parent ed00f71 commit 2a2d366
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 227 deletions.
2 changes: 0 additions & 2 deletions l10n_br_mdfe/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"views/modal/modal_rodoviario.xml",
"views/modal/modal_ferroviario.xml",
# Report
"report/reports.xml",
"report/damdfe_mdfe.xml",
"report/damdfe_report.xml",
],
"demo": [
Expand Down
165 changes: 0 additions & 165 deletions l10n_br_mdfe/report/damdfe_mdfe.xml

This file was deleted.

32 changes: 1 addition & 31 deletions l10n_br_mdfe/report/ir_actions_report.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
# Copyright 2024 Engenere.one
# Copyright 2024 - TODAY, Marcel Savegnago <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import base64
import logging
from io import BytesIO

from brazilfiscalreport.damdfe import Damdfe, DamdfeConfig, Margins
from erpbrasil.edoc.pdf import base
from lxml import etree

from odoo import _, api, models
from odoo.exceptions import UserError

_logger = logging.getLogger(__name__)


class IrActionsReport(models.Model):
_inherit = "ir.actions.report"

def temp_xml_autorizacao(self, xml_string):
"""TODO: Migrate-me to erpbrasil.edoc.pdf ASAP"""
root = etree.fromstring(xml_string)
ns = {None: "http://www.portalfiscal.inf.br/mdfe"}
new_root = etree.Element("mdfeProc", nsmap=ns)

protMDFe_node = etree.Element("protMDFe")
infProt = etree.SubElement(protMDFe_node, "infProt")
etree.SubElement(infProt, "tpAmb").text = "2"
etree.SubElement(infProt, "verAplic").text = ""
etree.SubElement(infProt, "dhRecbto").text = None
etree.SubElement(infProt, "nProt").text = ""
etree.SubElement(infProt, "digVal").text = ""
etree.SubElement(infProt, "cStat").text = ""
etree.SubElement(infProt, "xMotivo").text = ""

new_root.append(root)
new_root.append(protMDFe_node)
return etree.tostring(new_root)

def _render_qweb_html(self, res_ids, data=None):
if self.report_name == "main_template_damdfe":
return

Check warning on line 18 in l10n_br_mdfe/report/ir_actions_report.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_mdfe/report/ir_actions_report.py#L18

Added line #L18 was not covered by tests
Expand Down Expand Up @@ -103,9 +79,3 @@ def _get_damdfe_config(self, tmpLogo, company):
"margins": margins,
}
return DamdfeConfig(**damdfe_config)

def render_damdfe_erpbrasil(self, mdfe_xml):
pdf = base.ImprimirXml.imprimir(
string_xml=mdfe_xml,
)
return pdf, "pdf"
29 changes: 0 additions & 29 deletions l10n_br_mdfe/report/reports.xml

This file was deleted.

0 comments on commit 2a2d366

Please sign in to comment.