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 1 commit
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
38 changes: 21 additions & 17 deletions l10n_be_cooperator_portal/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ def _prepare_home_portal_values(self, counters):
values["tax_shelter_count"] = tax_shelter_count
return values

def _taxshelter_certificate_get_page_view_values(
self, taxshelter_certificate, access_token, **kwargs
def _tax_shelter_certificate_get_page_view_values(
self, tax_shelter_certificate, access_token, **kwargs
):
values = {
"company_id": request.env.company,
"page_name": "taxshelter",
"taxshelter": taxshelter_certificate,
"page_name": "tax_shelter_certificate",
"tax_shelter_certificate": tax_shelter_certificate,
}
return self._get_page_view_values(
taxshelter_certificate,
tax_shelter_certificate,
access_token,
values,
"my_taxshelter_certificates_history",
"my_tax_shelter_certificates_history",
False,
**kwargs,
)
Expand All @@ -64,9 +64,13 @@ def portal_my_tax_shelter_certificates(self, **kw):
* Shares Certifcates
"""
values = self._prepare_my_tax_shelter_certificates_values()
tax_shelters = values["tax_shelters"]
request.session["my_taxshelter_certificates_history"] = tax_shelters.ids
return request.render("l10n_be_cooperator_portal.portal_my_tax_shelter", 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:
Expand Down Expand Up @@ -96,10 +100,10 @@ def _prepare_my_tax_shelter_certificates_values(
values.update(
{
"company_id": request.env.company,
"tax_shelters": TaxShelterCertificate.search(domain).sorted(
"tax_shelter_certificates": TaxShelterCertificate.search(domain).sorted(
key=lambda r: r.declaration_id.fiscal_year, reverse=True
),
"page_name": "taxshelter",
"page_name": "tax_shelter_certificate",
"default_url": url,
}
)
Expand All @@ -122,10 +126,10 @@ def portal_my_tax_shelter_certificate_detail(
):
partner = request.env.user.partner_id
try:
taxshelter_certificate_sudo = self._document_check_access(
tax_shelter_certificate_sudo = self._document_check_access(
"tax.shelter.certificate", certificate_id, access_token
)
if taxshelter_certificate_sudo.partner_id != partner.commercial_partner_id:
if tax_shelter_certificate_sudo.partner_id != partner.commercial_partner_id:
raise Forbidden()
except (AccessError, MissingError):
return request.redirect("/my")
Expand All @@ -138,15 +142,15 @@ def portal_my_tax_shelter_certificate_detail(
query_string
)
return self._show_report(
model=taxshelter_certificate_sudo,
model=tax_shelter_certificate_sudo,
report_type=report_type,
report_ref=report_ref,
download=download,
)

values = self._taxshelter_certificate_get_page_view_values(
taxshelter_certificate_sudo, access_token, **kw
values = self._tax_shelter_certificate_get_page_view_values(
tax_shelter_certificate_sudo, access_token, **kw
)
return request.render(
"l10n_be_cooperator_portal.portal_taxshelter_page", values
"l10n_be_cooperator_portal.portal_tax_shelter_page", values
)
50 changes: 25 additions & 25 deletions l10n_be_cooperator_portal/views/portal_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@

<!-- Tax Shelter Certificate in the menu -->
<template
id="portal_my_home_menu_tax_shelter"
id="portal_my_home_menu_tax_shelter_certificate"
name="Portal layout: Cooperators Tax Shelter Certificate Menu Entries"
inherit_id="portal.portal_breadcrumbs"
priority="25"
>
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li
t-if="page_name == 'taxshelter'"
t-attf-class="breadcrumb-item #{'active ' if not taxshelter else ''}"
t-if="page_name == 'tax_shelter_certificate'"
t-attf-class="breadcrumb-item #{'active ' if not tax_shelter_certificate else ''}"
>
<a
t-if="taxshelter"
t-if="tax_shelter_certificate"
t-attf-href="/my/tax_shelter_certificates?{{ keep_query() }}"
>Tax Shelter Certificates</a>
<t t-else="">Tax Shelter Certificates</t>
</li>
<li t-if="taxshelter" class="breadcrumb-item active">
<li t-if="tax_shelter_certificate" class="breadcrumb-item active">
<t
t-out="taxshelter.declaration_id.name"
t-if="taxshelter.declaration_id.name"
t-out="tax_shelter_certificate.declaration_id.name"
t-if="tax_shelter_certificate.declaration_id.name"
/>
</li>
</xpath>
</template>

<!-- Tax Shelter Certificate on the main page -->
<template
id="portal_my_home_tax_shelter"
id="portal_my_home_tax_shelter_certificate"
name="Portal My Home: Cooperators Tax Shelter Certificate Entries"
inherit_id="portal.portal_my_home"
priority="25"
Expand All @@ -46,16 +46,16 @@


<!-- Tax Shelter Certificate page -->
<template id="portal_my_tax_shelter" name="My Tax Shelter">
<template id="portal_my_tax_shelter_certificate" name="My Tax Shelter">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True" />
<t t-call="portal.portal_searchbar">
<t t-set="title">Tax Shelter Certificates</t>
</t>
<t t-if="not tax_shelters">
<t t-if="not tax_shelter_certificates">
<p>There are currently no tax shelter certificates for your account.</p>
</t>
<t t-if="tax_shelters" t-call="portal.portal_table">
<t t-if="tax_shelter_certificates" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>Declaration Year</th>
Expand All @@ -64,36 +64,36 @@
<th />
</tr>
</thead>
<t t-foreach="tax_shelters" t-as="tax_shelter">
<t t-foreach="tax_shelter_certificates" t-as="tax_shelter_certificate">
<tr>
<td>
<a
t-att-href="tax_shelter.get_portal_url()"
t-att-title="tax_shelter.declaration_id.name"
t-att-href="tax_shelter_certificate.get_portal_url()"
t-att-title="tax_shelter_certificate.declaration_id.name"
>
<t
t-out="tax_shelter.declaration_id.name"
t-if="tax_shelter.declaration_id.name"
t-out="tax_shelter_certificate.declaration_id.name"
t-if="tax_shelter_certificate.declaration_id.name"
/>
<em t-else="">Draft Tax Shelter Certificate</em>
</a>
</td>
<td class="text-end">
<span
t-field="tax_shelter.total_amount"
t-field="tax_shelter_certificate.total_amount"
t-options='{"widget": "monetary", "display_currency": company_id.currency_id}'
/>
</td>
<td class="text-end">
<a
class="btn btn-secondary btn-block o_print_btn"
t-att-href="tax_shelter.get_portal_url(report_type='pdf', query_string='&amp;query_string=subscription')"
t-att-href="tax_shelter_certificate.get_portal_url(report_type='pdf', query_string='&amp;query_string=subscription')"
title="Print Subscription"
target="_blank"
><i class="fa fa-print" /> Subscription Certificate</a>
<a
class="btn btn-secondary btn-block o_print_btn"
t-att-href="tax_shelter.get_portal_url(report_type='pdf', query_string='&amp;query_string=shares')"
t-att-href="tax_shelter_certificate.get_portal_url(report_type='pdf', query_string='&amp;query_string=shares')"
title="Print Shares"
target="_blank"
><i class="fa fa-print" /> Shares Certificate</a>
Expand All @@ -106,7 +106,7 @@

<!-- Tax Shelter Certificate Content -->
<template
id="portal_taxshelter_page"
id="portal_tax_shelter_page"
name="Tax Shelter Portal Template"
inherit_id="portal.portal_sidebar"
primary="True"
Expand All @@ -118,7 +118,7 @@
<t t-set="classes" t-value="'col-lg-auto d-print-none'" />
<t t-set="title">
<h2 class="mb-0"><b
t-field="taxshelter.total_amount"
t-field="tax_shelter_certificate.total_amount"
data-id="total_amount"
t-options='{"widget": "monetary", "display_currency": company_id.currency_id}'
/> </h2>
Expand All @@ -132,9 +132,9 @@
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 mb-1">
<a
id="print_taxshelter_subscription"
id="print_tax_shelter_subscription"
class="btn btn-secondary btn-block o_print_btn"
t-att-href="taxshelter.get_portal_url(report_type='pdf', query_string='&amp;query_string=subscription')"
t-att-href="tax_shelter_certificate.get_portal_url(report_type='pdf', query_string='&amp;query_string=subscription')"
title="Print Subscription"
target="_blank"
><i
Expand All @@ -145,9 +145,9 @@
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 mb-1">
<a
id="print_taxshelter_shares"
id="print_tax_shelter_shares"
class="btn btn-secondary btn-block o_print_btn"
t-att-href="taxshelter.get_portal_url(report_type='pdf', query_string='&amp;query_string=shares')"
t-att-href="tax_shelter_certificate.get_portal_url(report_type='pdf', query_string='&amp;query_string=shares')"
title="Print Shares"
target="_blank"
><i
Expand Down