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

[16.0][MIG] l10n_be_cooperator_portal #93

Merged
merged 56 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
520a6b1
[ADD] emc_w_taxshelter: Tax Shelter Certificate
remytms Mar 7, 2018
78735c9
[FIX] emc_w_taxshelter: Access right issue
remytms Mar 28, 2018
c3b0c1e
[FIX] emc_w_taxshelter: PDF download issue
remytms May 2, 2018
e49c58a
[FIX] emc_w_taxshelter: Order of certificates
remytms May 2, 2018
6239723
[FIX] emc_w_taxshelter: Old link for certificates
remytms May 2, 2018
13fce3e
[FIX] emc_w_taxshelter: Use sudo explicitly
remytms Jun 10, 2018
be3f4dd
[FIX] emc_w_taxshelter: Correctly name certificate
remytms Jun 10, 2018
d25d074
[FIX] emc_w_taxshelter: Contributors
remytms Jun 10, 2018
cb7cc1f
[PEP8] pep8 code style refactoring
houssine78 Aug 22, 2018
010e2f0
[PEP8] fix pep8
houssine78 Mar 26, 2019
912ce99
[MIG] migrate to v12 still wip
houssine78 May 10, 2019
6ed62cb
Pypi setup
raneq Feb 10, 2020
70f7790
[ADD] module readmes
robinkeunen Apr 10, 2020
7ed8b48
[REF] OCA pre-commit compliance
robinkeunen Apr 21, 2020
2d9c307
automatic fixes
robinkeunen Apr 21, 2020
8fdc8b7
[REF] pretty xml
robinkeunen Apr 22, 2020
b02cf4e
[MIG] emc_website_taxshelter: adaptation to 12.0
vvrossem Jun 16, 2020
b687f26
[IMP] emc_website_taxshelter: black formatter
vvrossem Jun 16, 2020
4bbbf19
[IMP] emc_website_taxshelter: readme
vvrossem Jun 16, 2020
c10f418
[IMP] emc_taxshelter_report,emc_website_taxshelter: pre-commit
vvrossem Jun 16, 2020
bd16ccf
[FIX] emc_w_taxshelter: Typo
remytms Jun 26, 2020
ab5e6f8
make travis green again
robinkeunen Aug 31, 2020
1c04c3a
[FIX] emc_tax_shelter: exclude line from wrong black formatting
robinkeunen Aug 31, 2020
4beb9ef
[REF] pre-commit semanticless fixes
robinkeunen May 11, 2021
3f18a28
[FIX] Adjust website URLs in all manifest files
carmenbianca Nov 30, 2021
79f43bf
[REF] pre-commit semanticless fixes
robinkeunen May 11, 2021
ce49a8a
[FIX] emc_api: create and update requests based on _external_api_id
robinkeunen Jan 6, 2022
8edd070
[FIX] Run pre-commit on all files
carmenbianca Mar 8, 2022
b2a47f5
[UPD] Update all .pot files
Mar 8, 2022
4143bca
[FIX] easy_my_coop_website_taxshelter: Rename dependency
carmenbianca Mar 15, 2022
57decb7
[REF] easy_my_coop_website_taxshelter -> l10n_be_cooperator_portal
robinkeunen Mar 23, 2022
4bc3456
[REF] l10n_be_cooperator_portal: remove dependency to website
robinkeunen Mar 23, 2022
a6d64e6
[REF] l10n_be_cooperator_portal: Remove references to EMC in views
carmenbianca Mar 29, 2022
cce98bd
[REM] Extraneous .pot files
carmenbianca Mar 28, 2022
c06a01f
[UPD] Update l10n_be_cooperator_portal.pot
carmenbianca May 23, 2022
0559216
[FIX] SCRLfs → SC
carmenbianca Jun 29, 2022
cce56ce
[13.0][MIG] l10n_be_cooperator_portal: Migration to 13.0
carmenbianca Jun 29, 2022
bf973b9
[14.0][MIG] l10n_be_cooperator_portal: Migration to 14.0
carmenbianca Jun 29, 2022
eed28d5
[FIX] l10n_be_cooperator_portal: Pass company_id to templates
carmenbianca Jul 21, 2022
4273e17
[IMP] add fr_be translation
huguesdk Aug 27, 2022
b5301cc
[UPD] README.rst
github-grap-bot Aug 27, 2022
90cad62
[FIX] fix manifest and update readme
huguesdk Dec 9, 2022
942eedd
[UPD] README.rst
OCA-git-bot Sep 4, 2023
8d0ab57
[ADD] icon.png
OCA-git-bot Sep 4, 2023
cbd42d9
Added translation using Weblate (Italian)
mymage Sep 12, 2023
3813cd3
Translated using Weblate (Italian)
mymage Sep 13, 2023
b6b2eea
[MIG] l10n_be_cooperator_portal: Migration to 15.0
carmenbianca Oct 2, 2023
e162489
[MIG] l10n_be_cooperator_portal: Migration to 16.0
carmenbianca Oct 6, 2023
8e91473
[IMP] adapt to changes in odoo 16 and simplify
huguesdk Jan 24, 2024
2af4f4b
[FIX] list only validated certificates
huguesdk Jan 24, 2024
892d4ad
[IMP] allow to print certificates from the list
huguesdk Jan 24, 2024
3d7528e
[REF] make naming more uniform
huguesdk Jan 24, 2024
a32a90f
[FIX] fix title of portal pages
huguesdk Jan 24, 2024
ab52356
[MOV] rename main.py to portal.py
huguesdk Jan 24, 2024
1c9dbe2
[IMP] adjust copyright statements
huguesdk Jan 24, 2024
afb2ae1
[IMP] improve portal templates
huguesdk Jan 29, 2024
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
79 changes: 79 additions & 0 deletions l10n_be_cooperator_portal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
=============================
Tax Shelter reports in Portal
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3fbcb3b51707be9a6ec888029377322bbb87f1f065016d9845babaf192fe8262
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-OCA%2Fcooperative-lightgray.png?logo=github
:target: https://github.com/OCA/cooperative/tree/14.0/l10n_be_cooperator_portal
:alt: OCA/cooperative
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/cooperative-14-0/cooperative-14-0-l10n_be_cooperator_portal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/cooperative&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Give access to Tax Shelter Report in the website portal.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/cooperative/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/cooperative/issues/new?body=module:%20l10n_be_cooperator_portal%0Aversion:%2014.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
~~~~~~~

* Coop IT Easy SC

Contributors
~~~~~~~~~~~~

* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Rémy TAYMANS <remy@coopiteasy.be>
* Vincent VAN ROSSEM <vincent@coopiteasy.be>

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/cooperative <https://github.com/OCA/cooperative/tree/14.0/l10n_be_cooperator_portal>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions l10n_be_cooperator_portal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2018 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import controllers
21 changes: 21 additions & 0 deletions l10n_be_cooperator_portal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2018 Coop IT Easy SC
# SPDX-FileContributor: Rémy Taymans <remy@coopiteasy.be>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "Tax Shelter reports in Portal",
"version": "16.0.1.0.0",
"depends": [
"portal",
"l10n_be_cooperator",
],
"summary": "Give access to Tax Shelter Report in the portal.",
"author": "Coop IT Easy SC, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Cooperative Management",
"website": "https://github.com/OCA/cooperative",
"data": [
"views/portal_templates.xml",
],
}
5 changes: 5 additions & 0 deletions l10n_be_cooperator_portal/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2018 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import portal
156 changes: 156 additions & 0 deletions l10n_be_cooperator_portal/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# SPDX-FileCopyrightText: 2018 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from werkzeug.exceptions import Forbidden

from odoo import http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request
from odoo.osv import expression

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


class TaxShelterPortal(CustomerPortal):
def _prepare_home_portal_values(self, counters):
values = super()._prepare_home_portal_values(counters)
if "tax_shelter_count" in counters:
# sudo is needed because regular users don't have access to the
# tax.shelter.certificate model, even for their own records.
tax_shelter_count = (
request.env["tax.shelter.certificate"]
.sudo()
.search_count(self._get_tax_shelter_certificates_domain())
)
values["tax_shelter_count"] = tax_shelter_count
return values

def _tax_shelter_certificate_get_page_view_values(
self, tax_shelter_certificate, access_token, **kwargs
):
values = {
"company_id": request.env.company,
"page_name": "tax_shelter_certificate",
"tax_shelter_certificate": tax_shelter_certificate,
}
return self._get_page_view_values(
tax_shelter_certificate,
access_token,
values,
"my_tax_shelter_certificates_history",
False,
**kwargs,
)

def _get_tax_shelter_certificates_domain(self):
partner = request.env.user.partner_id
return [
("partner_id", "=", partner.commercial_partner_id.id),
("state", "in", ("validated", "sent")),
]

@http.route(
[
"/my/tax_shelter_certificates",
],
type="http",
auth="user",
website=True,
)
def portal_my_tax_shelter_certificates(self, **kw):
"""Render a page that lists the tax shelter reports:
* Tax Shelter Certificates
* Shares Certifcates
"""
values = self._prepare_my_tax_shelter_certificates_values()
tax_shelter_certificates = values["tax_shelter_certificates"]
request.session[
"my_tax_shelter_certificates_history"
] = tax_shelter_certificates.ids
return request.render(
"l10n_be_cooperator_portal.portal_my_tax_shelter_certificate", values
)

# this method is a copy of PortalAccount._prepare_my_invoices_values()
# from the account module in odoo 16, with a few changes (most notably:
# the pager has been removed). please update accordingly when porting to
# newer versions.
def _prepare_my_tax_shelter_certificates_values(
self, domain=None, url="/my/tax_shelter_certificates"
):
values = self._prepare_portal_layout_values()
# sudo is needed because regular users don't have access to the
# tax.shelter.certificate model, even for their own records.
TaxShelterCertificate = request.env["tax.shelter.certificate"].sudo()

domain = expression.AND(
[
domain or [],
self._get_tax_shelter_certificates_domain(),
]
)

# sorting, filtering and pager support has been removed because:
# * the number of records is very small
# * the ordering cannot be computed by the database because it is
# computed with declaration_id.fiscal_year. database ordering only
# works with fields on the model itself.

values.update(
{
"company_id": request.env.company,
"tax_shelter_certificates": TaxShelterCertificate.search(domain).sorted(
key=lambda r: r.declaration_id.fiscal_year, reverse=True
),
"page_name": "tax_shelter_certificate",
"default_url": url,
}
)
return values

@http.route(
["/my/tax_shelter_certificates/<int:certificate_id>"],
type="http",
auth="public",
website=True,
)
def portal_my_tax_shelter_certificate_detail(
self,
certificate_id,
access_token=None,
report_type=None,
download=False,
certificate_type=None,
**kw
):
partner = request.env.user.partner_id
try:
tax_shelter_certificate_sudo = self._document_check_access(
"tax.shelter.certificate", certificate_id, access_token
)
if tax_shelter_certificate_sudo.partner_id != partner.commercial_partner_id:
raise Forbidden()
except (AccessError, MissingError):
return request.redirect("/my")

if report_type in ("html", "pdf", "text") and certificate_type in (
"subscription",
"shares",
):
report_ref = "l10n_be_cooperator.action_tax_shelter_%s_report" % (
certificate_type
)
return self._show_report(
model=tax_shelter_certificate_sudo,
report_type=report_type,
report_ref=report_ref,
download=download,
)

values = self._tax_shelter_certificate_get_page_view_values(
tax_shelter_certificate_sudo, access_token, **kw
)
return request.render(
"l10n_be_cooperator_portal.portal_tax_shelter_page", values
)
62 changes: 62 additions & 0 deletions l10n_be_cooperator_portal/i18n/fr_BE.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_be_cooperator_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_BE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "<i class=\"fa fa-print\"/> Shares Certificate"
msgstr "<i class=\"fa fa-print\"/> Attestation de parts"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "<i class=\"fa fa-print\"/> Subscription Certificate"
msgstr "<i class=\"fa fa-print\"/> Certificat de souscription"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Declaration Year"
msgstr "Année de déclaration"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Draft Tax Shelter Certificate"
msgstr "Certificats Tax shelter brouillon"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "Print Shares"
msgstr "Imprimer attestation de parts"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "Print Subscription"
msgstr "Imprimer certificat de souscription"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_home_menu_tax_shelter
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_home_tax_shelter
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Tax Shelter Certificates"
msgstr "Certificats Tax shelter"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "There are currently no tax shelter certificates for your account."
msgstr "Il n'y a actuellement aucun certificat Tax shelter pour votre compte."

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Total Amount"
msgstr "Montant total"
65 changes: 65 additions & 0 deletions l10n_be_cooperator_portal/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_be_cooperator_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-09-20 17:52+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "<i class=\"fa fa-print\"/> Shares Certificate"
msgstr "<i class=\"fa fa-print\"/> Condividi cetificato"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "<i class=\"fa fa-print\"/> Subscription Certificate"
msgstr "<i class=\"fa fa-print\"/> Crtificato di iscrizione"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Declaration Year"
msgstr "Anno dichiarazione"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Draft Tax Shelter Certificate"
msgstr "Bozza certficato scudo fiscale"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "Print Shares"
msgstr "Stampa quote"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_taxshelter_page
msgid "Print Subscription"
msgstr "Stampa iscrizione"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_home_menu_tax_shelter
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_home_tax_shelter
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Tax Shelter Certificates"
msgstr "Certiicati scudo fiscale"

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "There are currently no tax shelter certificates for your account."
msgstr ""
"Attualmente non ci sono certificati dello scudo fiscale per il tuo conto."

#. module: l10n_be_cooperator_portal
#: model_terms:ir.ui.view,arch_db:l10n_be_cooperator_portal.portal_my_tax_shelter
msgid "Total Amount"
msgstr "Importo totale"
Loading
Loading