diff --git a/controllers/__init__.py b/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ed5c1788c063fee3739c1d0cae259c55dfa3e9b2 --- /dev/null +++ b/controllers/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2022 Le Filament (<http://www.le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import portal diff --git a/controllers/portal.py b/controllers/portal.py new file mode 100644 index 0000000000000000000000000000000000000000..ee55f8b34a0f01caadde860ee99ffadd4434477a --- /dev/null +++ b/controllers/portal.py @@ -0,0 +1,20 @@ +# Copyright 2022 Le Filament (<http://www.le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from odoo import http, _ +from odoo.addons.portal.controllers.portal import CustomerPortal + + +class PortalAccount(CustomerPortal): + + @http.route(['/my/invoices/<int:invoice_id>'], type='http', auth="public", website=True) + def portal_my_invoice_detail(self, invoice_id, access_token=None, report_type=None, download=False, **kw): + invoice_sudo = self._document_check_access('acc.account', invoice_id, access_token) + + if report_type in ('html', 'pdf', 'text'): + return self._show_report( + model=invoice_sudo, + report_type=report_type, + report_ref='acc_account.acc_account_invoices', + download=download) diff --git a/models/acc_operation.py b/models/acc_operation.py index 494b816d0238ebe7ab513fea82795756e5b9814c..0d420f24c33fe04b31c0e22b85c0b5bc34d1ae08 100644 --- a/models/acc_operation.py +++ b/models/acc_operation.py @@ -115,7 +115,7 @@ class AccOperation(models.Model): ("acc_counter_id", "=", acc_delivery_id.id), ("date_slot", ">=", date_start), ("date_slot", "<=", date_end), - ("comp_data_type", "=", "auotocons"), + ("comp_data_type", "=", "autocons"), ], ["power", "acc_operation_id", "date_slot"], ["acc_counter_id"],