From b1d7b0f2d841d24359c509a85fc86418bfae12f1 Mon Sep 17 00:00:00 2001 From: David Ramia Date: Sat, 13 May 2023 01:05:44 +0200 Subject: [PATCH] [MIG] l10n_es_facturae: Migration to 16.0 --- l10n_es_facturae/__manifest__.py | 2 +- l10n_es_facturae/tests/common.py | 4 +-- l10n_es_facturae/views/account_move_view.xml | 1 + l10n_es_facturae/views/res_partner_view.xml | 26 +++++++++++--------- l10n_es_facturae/wizard/create_facturae.py | 8 +++--- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/l10n_es_facturae/__manifest__.py b/l10n_es_facturae/__manifest__.py index 74695c4108c..0a5b2baf265 100644 --- a/l10n_es_facturae/__manifest__.py +++ b/l10n_es_facturae/__manifest__.py @@ -8,7 +8,7 @@ { "name": "Creación de Facturae", - "version": "15.0.1.4.0", + "version": "16.0.1.0.0", "author": "ASR-OSS, " "FactorLibre, " "Tecon, " diff --git a/l10n_es_facturae/tests/common.py b/l10n_es_facturae/tests/common.py index 488b60ddc53..d61b6f536b7 100644 --- a/l10n_es_facturae/tests/common.py +++ b/l10n_es_facturae/tests/common.py @@ -4,10 +4,10 @@ import base64 from datetime import timedelta +from unittest import mock import xmlsig from lxml import etree -from mock import patch from odoo import exceptions, fields from odoo.tools.misc import mute_logger @@ -262,7 +262,7 @@ def test_facturae_with_attachments(self): self.move.action_post() self.move.name = "2999/99999" self.partner.attach_invoice_as_annex = True - with patch( + with mock.patch( "odoo.addons.base.models.ir_actions_report.IrActionsReport._render_qweb_pdf" ) as ptch: ptch.return_value = (b"1234", "pdf") diff --git a/l10n_es_facturae/views/account_move_view.xml b/l10n_es_facturae/views/account_move_view.xml index 0e3379a5518..9a840ddaa6f 100644 --- a/l10n_es_facturae/views/account_move_view.xml +++ b/l10n_es_facturae/views/account_move_view.xml @@ -28,6 +28,7 @@ icon="fa-tags" attrs="{'column_invisible': [('parent.facturae','=', False)]}" type="object" + title="Edit" /> diff --git a/l10n_es_facturae/views/res_partner_view.xml b/l10n_es_facturae/views/res_partner_view.xml index 25588fd0149..9a3158ef887 100644 --- a/l10n_es_facturae/views/res_partner_view.xml +++ b/l10n_es_facturae/views/res_partner_view.xml @@ -6,10 +6,9 @@ 99 form - - + - - + + + + + - - + - - - - - + + + diff --git a/l10n_es_facturae/wizard/create_facturae.py b/l10n_es_facturae/wizard/create_facturae.py index 6be3a4f0eb1..ee006cb600a 100644 --- a/l10n_es_facturae/wizard/create_facturae.py +++ b/l10n_es_facturae/wizard/create_facturae.py @@ -57,13 +57,13 @@ def create_facturae_file(self): assert active_model == "account.move", "Bad context propagation" move = self.env["account.move"].browse(move_ids[0]).ensure_one() if self.firmar_facturae: - move_file = self.env.ref("l10n_es_facturae.report_facturae_signed")._render( - move.ids + move_file = self.env["ir.actions.report"]._render( + "l10n_es_facturae.report_facturae_signed", move.ids )[0] file_name = ("facturae_" + move.name + ".xsig").replace("/", "-") else: - move_file = self.env.ref("l10n_es_facturae.report_facturae")._render( - move.ids + move_file = self.env["ir.actions.report"]._render( + "l10n_es_facturae.report_facturae", move.ids )[0] file_name = ("facturae_" + move.name + ".xml").replace("/", "-") file = base64.b64encode(move_file)