diff --git a/l10n_pt_account_invoicexpress/__manifest__.py b/l10n_pt_account_invoicexpress/__manifest__.py index 4df80d90..9f794028 100644 --- a/l10n_pt_account_invoicexpress/__manifest__.py +++ b/l10n_pt_account_invoicexpress/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Portugal InvoiceXpress Integration", "summary": "Portuguese certified invoices using InvoiceXpress", - "version": "14.0.4.1.3", + "version": "15.0.1.0.0", "author": "Open Source Integrators, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/l10n-portugal", diff --git a/l10n_pt_account_invoicexpress/data/mail_template.xml b/l10n_pt_account_invoicexpress/data/mail_template.xml index 9210f121..bafe64fe 100644 --- a/l10n_pt_account_invoicexpress/data/mail_template.xml +++ b/l10n_pt_account_invoicexpress/data/mail_template.xml @@ -1,28 +1,31 @@ - - - InvoiceXpress: Send Invoice by Email - - Sua Fatura ${object.name | safe} - ${object.partner_id.email | safe} - ${object.env.user.email | safe} - -

-Olá, -
-Enviamos em anexo a fatura ${object.name | safe} -% if object.ref: - relativa à sua encomenda ${object.ref | safe} -% endif -. -

-Obrigado -% if user.signature: -
- ${user.signature | safe} -% endif -

-
- ${object.partner_id.lang} - -
+ + + + InvoiceXpress: Send Invoice by Email + + Sua Fatura ${object.name | safe} + ${object.partner_id.email | safe} + ${object.env.user.email | safe} + +

+ Olá, +
+ Enviamos em anexo a fatura ${object.name | safe} + % if object.ref: + relativa à sua encomenda ${object.ref | safe} + % endif + . +
+
+ Obrigado + % if user.signature: +
+ ${user.signature | safe} + % endif +

+
+ ${object.partner_id.lang} + +
+
diff --git a/l10n_pt_account_invoicexpress/i18n/l10n_pt_account_invoicexpress.pot b/l10n_pt_account_invoicexpress/i18n/l10n_pt_account_invoicexpress.pot index 2da7e657..029420a2 100644 --- a/l10n_pt_account_invoicexpress/i18n/l10n_pt_account_invoicexpress.pot +++ b/l10n_pt_account_invoicexpress/i18n/l10n_pt_account_invoicexpress.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/l10n_pt_account_invoicexpress/i18n/pt.po b/l10n_pt_account_invoicexpress/i18n/pt.po index 25b23678..b0d36b23 100644 --- a/l10n_pt_account_invoicexpress/i18n/pt.po +++ b/l10n_pt_account_invoicexpress/i18n/pt.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-11-18 20:36+0000\n" "Last-Translator: Daniel Reis \n" diff --git a/l10n_pt_account_invoicexpress/models/account_invoicexpress.py b/l10n_pt_account_invoicexpress/models/account_invoicexpress.py index d11d8228..04697ad5 100644 --- a/l10n_pt_account_invoicexpress/models/account_invoicexpress.py +++ b/l10n_pt_account_invoicexpress/models/account_invoicexpress.py @@ -7,9 +7,8 @@ import pprint import requests -from werkzeug.urls import url_join - from odoo import _, exceptions, models +from werkzeug.urls import url_join _logger = logging.getLogger(__name__) @@ -57,12 +56,8 @@ def _check_http_status(self, response): # TODO: implement request rate limit if response.status_code not in [200, 201]: raise exceptions.ValidationError( - _( - "Error running API request ({} {}):\n{}".format( - response.status_code, response.reason, response.json() - ) - ) - ) + _('Error running API request ({} {}):\n{}').format(response.status_code, response.reason, + response.json())) def call( self, diff --git a/l10n_pt_account_invoicexpress/models/account_move.py b/l10n_pt_account_invoicexpress/models/account_move.py index eb2d9ac2..7a4105b2 100644 --- a/l10n_pt_account_invoicexpress/models/account_move.py +++ b/l10n_pt_account_invoicexpress/models/account_move.py @@ -11,9 +11,10 @@ class AccountMove(models.Model): @api.depends("restrict_mode_hash_table", "state") def _compute_show_reset_to_draft_button(self): - super()._compute_show_reset_to_draft_button() + res = super()._compute_show_reset_to_draft_button() # InvoiceXpress generated invoices can't be set to Draft self.filtered("invoicexpress_id").write({"show_reset_to_draft_button": False}) + return res @api.depends("move_type", "journal_id.use_invoicexpress") def _compute_can_invoicexpress(self): @@ -75,8 +76,8 @@ def _compute_invoicexpress_doc_type(self): readonly=False, copy=False, help="Select the type of legal invoice document" - " to be created by InvoiceXpress." - " If unset, InvoiceXpress will not be used.", + " to be created by InvoiceXpress." + " If unset, InvoiceXpress will not be used.", ) @api.constrains("journal_id", "company_id") @@ -124,7 +125,7 @@ def _prepare_invoicexpress_lines(self): items.append( { "name": line.product_id.default_code - or line.product_id.display_name, + or line.product_id.display_name, "description": line._get_invoicexpress_descr(), "unit_price": line.price_unit, "quantity": line.quantity, @@ -305,5 +306,5 @@ def _get_invoicexpress_descr(self): ref = self.product_id.default_code prefix = "[%s] " % ref if ref and self.name.startswith(prefix): - res = self.name[len(prefix) :] + res = self.name[len(prefix):] return res diff --git a/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py b/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py index e8d859d8..75595d3f 100644 --- a/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py +++ b/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py @@ -1,7 +1,6 @@ from unittest.mock import Mock, patch import requests - from odoo import fields from odoo.tests import Form, common diff --git a/l10n_pt_account_invoicexpress/views/account_journal_view.xml b/l10n_pt_account_invoicexpress/views/account_journal_view.xml index fdbfd993..65b1f8e9 100644 --- a/l10n_pt_account_invoicexpress/views/account_journal_view.xml +++ b/l10n_pt_account_invoicexpress/views/account_journal_view.xml @@ -4,16 +4,15 @@ Journal Form: add Invoicexpress account.journal - + - - - + + diff --git a/l10n_pt_account_invoicexpress/views/account_move_view.xml b/l10n_pt_account_invoicexpress/views/account_move_view.xml index 5408c392..d0727e73 100644 --- a/l10n_pt_account_invoicexpress/views/account_move_view.xml +++ b/l10n_pt_account_invoicexpress/views/account_move_view.xml @@ -4,12 +4,12 @@ account.move.form account.move - +
- - + +
@@ -15,9 +15,12 @@ + Generate an API key + /> + Generate an API key +
- +
diff --git a/setup/l10n_pt_account_invoicexpress/odoo/addons/l10n_pt_account_invoicexpress b/setup/l10n_pt_account_invoicexpress/odoo/addons/l10n_pt_account_invoicexpress new file mode 120000 index 00000000..1612345c --- /dev/null +++ b/setup/l10n_pt_account_invoicexpress/odoo/addons/l10n_pt_account_invoicexpress @@ -0,0 +1 @@ +../../../../l10n_pt_account_invoicexpress \ No newline at end of file diff --git a/setup/l10n_pt_account_invoicexpress/setup.py b/setup/l10n_pt_account_invoicexpress/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/l10n_pt_account_invoicexpress/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)