diff --git a/l10n_pt_account_invoicexpress/data/mail_template.xml b/l10n_pt_account_invoicexpress/data/mail_template.xml index bafe64fe..483b80e4 100644 --- a/l10n_pt_account_invoicexpress/data/mail_template.xml +++ b/l10n_pt_account_invoicexpress/data/mail_template.xml @@ -1,31 +1,29 @@ - - - - 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/models/account_invoicexpress.py b/l10n_pt_account_invoicexpress/models/account_invoicexpress.py index 04697ad5..77074dcf 100644 --- a/l10n_pt_account_invoicexpress/models/account_invoicexpress.py +++ b/l10n_pt_account_invoicexpress/models/account_invoicexpress.py @@ -7,9 +7,10 @@ import pprint import requests -from odoo import _, exceptions, models from werkzeug.urls import url_join +from odoo import _, exceptions, models + _logger = logging.getLogger(__name__) @@ -56,8 +57,10 @@ 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 7a4105b2..2bed482f 100644 --- a/l10n_pt_account_invoicexpress/models/account_move.py +++ b/l10n_pt_account_invoicexpress/models/account_move.py @@ -76,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") @@ -125,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, @@ -306,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 75595d3f..e8d859d8 100644 --- a/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py +++ b/l10n_pt_account_invoicexpress/tests/test_invoicexpress.py @@ -1,6 +1,7 @@ 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 65b1f8e9..2fc1c050 100644 --- a/l10n_pt_account_invoicexpress/views/account_journal_view.xml +++ b/l10n_pt_account_invoicexpress/views/account_journal_view.xml @@ -1,22 +1,19 @@ - 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 d0727e73..1c7df7e7 100644 --- a/l10n_pt_account_invoicexpress/views/account_move_view.xml +++ b/l10n_pt_account_invoicexpress/views/account_move_view.xml @@ -4,12 +4,11 @@ account.move.form account.move - + -
- - + + -
-

InvoiceXpress

-