[ADD] subscription_oca_portal: expose subscriptions in the portal
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m34s
tests / test (pull_request) Successful in 2m39s

Add the missing portal layer for subscription_oca, modelled on the
portal of the OCA contract module:

- sale.subscription inherits portal.mixin; access_url resolves to
  /my/subscriptions/<id>
- read-only ACLs (base.group_portal) on subscription, line, stage and
  template models, with record rules restricting both subscription and
  lines to the user's own commercial partner
- CustomerPortal extension: home counter, paginated and sortable list,
  detail page with lines, totals and a portal chatter
- related invoices are listed only when posted and actually readable by
  the visitor, since subscription_oca creates them in sudo
- /my home entry with a recurring-cycle icon (circular arrows around a
  calendar, matching the portal icon palette)
- 13 tests, fr.po translation catalog

Chatter headings carry mb-4: the frontend portal chatter paints an
opaque sticky bar 15px above its container, which would otherwise clip
the heading (same overlap exists on core portal pages, hidden behind
their taller h3).

Portal body loop variables avoid the names `invoice` and `subscription`:
qweb renders a t-call body before the layout it calls in the same values
dict, so top-level loop variables leak into the breadcrumb context where
account's portal_breadcrumbs template tests t-if="invoice".
This commit is contained in:
Stéphan Sainléger
2026-10-20 23:18:43 +02:00
parent 252fee9c99
commit 18e7ae8925
18 changed files with 1437 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# Copyright 2026 Stéphan Sainléger (Elabore)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "subscription_oca_portal",
"version": "18.0.1.0.0",
"author": "Elabore",
"website": "https://git.elabore.coop/elabore/sale-tools",
"maintainer": "Stéphan Sainléger",
"license": "AGPL-3",
"category": "Sales",
"summary": "Let portal users consult their own subscriptions.",
"depends": [
"subscription_oca",
"portal",
],
"data": [
"security/ir.model.access.csv",
"security/subscription_portal_security.xml",
"views/subscription_portal_templates.xml",
],
"assets": {
"web.assets_tests": [
"subscription_oca_portal/static/src/js/subscription_portal_tour.esm.js",
],
},
"installable": True,
"auto_install": False,
"application": False,
}