Skip to content

Commit

Permalink
[MIG]l10n_es_facturae_face: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelregidor committed Sep 20, 2024
1 parent 6ab7b50 commit 1d84a77
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 38 deletions.
2 changes: 2 additions & 0 deletions l10n_es_facturae_face/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Contributors

- Enric Tobella <etobella@creublanca.es>
- Eric Antones <eantones@nuobit.com>
- Manuel Regidor <manuel.regidor@sygel.es>
- Valentín Vinagre <valentin.vinagre@sygel.es>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_facturae_face/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Envío de Facturae a FACe",
"version": "16.0.1.2.0",
"version": "17.0.1.0.0",
"author": "Creu Blanca, Odoo Community Association (OCA)",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/l10n-spain",
Expand Down
24 changes: 0 additions & 24 deletions l10n_es_facturae_face/migrations/16.0.1.0.0/pre-migration.py

This file was deleted.

2 changes: 1 addition & 1 deletion l10n_es_facturae_face/models/edi_exchange_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _cron_face_update_method(self, company_domain=False):
return

Check warning on line 62 in l10n_es_facturae_face/models/edi_exchange_record.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_facturae_face/models/edi_exchange_record.py#L62

Added line #L62 was not covered by tests
for company in self.env["res.company"].search(company_domain):
company_integrations = integrations.filtered(
lambda r: r.record.company_id == company
lambda r, company=company: r.record.company_id == company
)
if not company_integrations:
continue
Expand Down
4 changes: 1 addition & 3 deletions l10n_es_facturae_face/models/wsse_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ class Signature(MemorySignature):
cert file."""

def __init__(self, key_file, certfile, password=None):
super(Signature, self).__init__(
_read_file(key_file), _read_file(certfile), password
)
super().__init__(_read_file(key_file), _read_file(certfile), password)

Check warning on line 67 in l10n_es_facturae_face/models/wsse_signature.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_facturae_face/models/wsse_signature.py#L67

Added line #L67 was not covered by tests


def sign_envelope(envelope, public_cert, private_key, certfile, password):
Expand Down
2 changes: 2 additions & 0 deletions l10n_es_facturae_face/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Enric Tobella \<<etobella@creublanca.es>\>
- Eric Antones \<<eantones@nuobit.com>\>
- Manuel Regidor \<<manuel.regidor@sygel.es>\>
- Valentín Vinagre \<<valentin.vinagre@sygel.es>\>
2 changes: 2 additions & 0 deletions l10n_es_facturae_face/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ <h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
<li>Eric Antones &lt;<a class="reference external" href="mailto:eantones&#64;nuobit.com">eantones&#64;nuobit.com</a>&gt;</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
<li>Valentín Vinagre &lt;<a class="reference external" href="mailto:valentin.vinagre&#64;sygel.es">valentin.vinagre&#64;sygel.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
9 changes: 8 additions & 1 deletion l10n_es_facturae_face/tests/test_facturae_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import logging
from unittest import mock

import requests

from odoo import exceptions

from odoo.addons.edi_oca.tests.common import EDIBackendCommonComponentRegistryTestCase
Expand All @@ -23,6 +25,7 @@ class EDIBackendTestCase(
):
@classmethod
def setUpClass(cls):
cls._super_send = requests.Session.send
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

Expand Down Expand Up @@ -145,7 +148,6 @@ def setUpClass(cls):
self.move = self.env["account.move"].create(
{
"partner_id": self.partner.id,
# "account_id": self.partner.property_account_receivable_id.id,
"journal_id": self.sale_journal.id,
"invoice_date": "2016-03-12",
"payment_mode_id": self.payment_mode.id,
Expand Down Expand Up @@ -174,6 +176,11 @@ def setUpClass(cls):
"l10n_es_facturae_face.facturae_face_update_exchange_type"
)

# Don't block external requests.
@classmethod
def _request_handler(cls, s, r, /, **kw):
return cls._super_send(s, r, **kw)

def test_constrain_company_mail(self):
with self.assertRaises(exceptions.ValidationError):
self.main_company.face_email = "test"
Expand Down
4 changes: 1 addition & 3 deletions l10n_es_facturae_face/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
type="action"
string="Cancel FACe"
context="{'default_move_id': id}"
attrs="{'invisible': ['|',
('l10n_es_facturae_status', '=', False),
('l10n_es_facturae_cancellation_status', 'not in', ['face-4100', 'face-4400'])]}"
invisible="not l10n_es_facturae_status or l10n_es_facturae_cancellation_status not in ['face-4100', 'face-4400']"
/>
</button>
<field name="facturae_end_date" position="after">
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_facturae_face/views/edi_exchange_record.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<page
name="facturae"
string="Facturae"
attrs="{'invisible': [('type_id', '!=', %(l10n_es_facturae_face.facturae_exchange_type)s)]}"
invisible="type_id != %(l10n_es_facturae_face.facturae_exchange_type)s"
>
<group>
<group name="facturae_group">
Expand Down
5 changes: 1 addition & 4 deletions l10n_es_facturae_face/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
expr="//group[@name='group_facturae']/field[@name='facturae_version']"
position="before"
>
<field
name="l10n_es_facturae_sending_code"
attrs="{'invisible': [('facturae', '=', False)]}"
/>
<field name="l10n_es_facturae_sending_code" invisible="not facturae" />
</xpath>
</field>
</record>
Expand Down

0 comments on commit 1d84a77

Please sign in to comment.