Skip to content

Commit

Permalink
[MIG] l10n_es_facturae: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiadavid committed May 15, 2023
1 parent 98b7f33 commit b1d7b0f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion l10n_es_facturae/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
4 changes: 2 additions & 2 deletions l10n_es_facturae/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions l10n_es_facturae/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
icon="fa-tags"
attrs="{'column_invisible': [('parent.facturae','=', False)]}"
type="object"
title="Edit"
/>
</xpath>
<notebook position="inside">
Expand Down
26 changes: 15 additions & 11 deletions l10n_es_facturae/views/res_partner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="priority">99</field>
<field name="type">form</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<xpath expr="//field[@name='child_ids']/form/sheet/group" position="inside">
<group>
<group groups="account.group_account_invoice">
<group
string="Facturae"
attrs="{'invisible': ['|', ('parent.facturae', '=', False), ('type', '!=', 'invoice')]}"
Expand All @@ -24,15 +23,19 @@
</group>
</group>
</xpath>
<group name='accounting_entries' position="inside">
<field name="facturae" />
<xpath expr="/form" position="inside">
<field name="parent_facturae" invisible="1" />
<field name="facturae" invisible="1" />
</xpath>
<group name='accounting_entries' position="inside">
<field name="facturae" groups="account.group_account_invoice" />
</group>
<group name="accounting_entries" position="after">
<group
name="group_facturae"
string="Facturae"
attrs="{'invisible': [('facturae', '=', False), ('parent_facturae', '=', False)]}"
groups="account.group_account_invoice"
>
<field name="facturae_version" />
<field
Expand All @@ -56,23 +59,24 @@
name="group_facturae"
string="Facturae"
attrs="{'invisible': ['|', ('type', '!=', 'invoice'), ('parent_facturae', '=', False)]}"
groups="account.group_account_invoice"
>
<field name="facturae_version" />
<field
<field name="facturae_version" />
<field
name="organo_gestor"
attrs="{'required': [('facturae', '=', True)]}"
/>
<field
<field
name="unidad_tramitadora"
attrs="{'required': [('facturae', '=', True)]}"
/>
<field
<field
name="oficina_contable"
attrs="{'required': [('facturae', '=', True)]}"
/>
<field name="organo_proponente" />
<field name="attach_invoice_as_annex" />
</group>
<field name="organo_proponente" />
<field name="attach_invoice_as_annex" />
</group>
</page>
</field>
</record>
Expand Down
8 changes: 4 additions & 4 deletions l10n_es_facturae/wizard/create_facturae.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1d7b0f

Please sign in to comment.