Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4332][ADD] account_invoice_custom_portal_report #224

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions account_invoice_custom_portal_report/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
====================================
Account Invoice Custom Portal Report
====================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Fhls--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/hls-custom/tree/12.0/account_invoice_custom_portal_report
:alt: qrtl/hls-custom

|badge1| |badge2| |badge3|

This module allows users to change the report template of the portal customer invoice view by setting up
the invoice report in the company.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/hls-custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/qrtl/hls-custom/issues/new?body=module:%20account_invoice_custom_portal_report%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Quartile

Maintainers
~~~~~~~~~~~

This module is part of the `qrtl/hls-custom <https://github.com/qrtl/hls-custom/tree/12.0/account_invoice_custom_portal_report>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions account_invoice_custom_portal_report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
13 changes: 13 additions & 0 deletions account_invoice_custom_portal_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Custom Portal Report",
"version": "12.0.1.0.0",
"category": "Portal",
"license": "AGPL-3",
"author": "Quartile",
"website": "https://www.quartile.co",
"depends": ["account"],
"data": ["views/res_company_views.xml"],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import portal
16 changes: 16 additions & 0 deletions account_invoice_custom_portal_report/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.addons.portal.controllers.portal import CustomerPortal
from odoo.http import request


class CustomerPortal(CustomerPortal):
def _show_report(self, model, report_type, report_ref, download=False):
if not (model._name == "account.invoice" and model.type == "out_invoice"):
return super()._show_report(model, report_type, report_ref, download)
invoice_report = request.env.user.company_id.customer_invoice_portal_report
if invoice_report:
external_id = invoice_report.get_external_id()
report_ref = external_id.get(invoice_report.id)
return super()._show_report(model, report_type, report_ref, download)
31 changes: 31 additions & 0 deletions account_invoice_custom_portal_report/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_custom_portal_report
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 07:35+0000\n"
"PO-Revision-Date: 2024-06-24 07:35+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_invoice_custom_portal_report
#: model:ir.model,name:account_invoice_custom_portal_report.model_res_company
msgid "Companies"
msgstr "会社"

#. module: account_invoice_custom_portal_report
#: model:ir.model.fields,field_description:account_invoice_custom_portal_report.field_res_company__customer_invoice_portal_report
msgid "Customer Invoice Portal Report"
msgstr "顧客請求書レポート(ポータル)"

#. module: account_invoice_custom_portal_report
#: model:ir.model.fields,help:account_invoice_custom_portal_report.field_res_company__customer_invoice_portal_report
msgid "This report template will be used in the customer portal to show the customer invoice."
msgstr "このレポートテンプレートはポータルで顧客請求書を表示するために使用されます。"
1 change: 1 addition & 0 deletions account_invoice_custom_portal_report/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_company
15 changes: 15 additions & 0 deletions account_invoice_custom_portal_report/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

customer_invoice_portal_report = fields.Many2one(
"ir.actions.report",
domain="[('model', '=', 'account.invoice')]",
help="This report template will be used in the customer portal to "
"show the customer invoice.",
)
2 changes: 2 additions & 0 deletions account_invoice_custom_portal_report/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows users to change the report template of the portal customer invoice view by setting up
the invoice report in the company.
Loading
Loading