[IMP] partner_portal_extra_links: add buttons in portal /my/home

This commit is contained in:
Stéphan Sainléger
2026-06-22 21:41:49 +02:00
parent a213def5a1
commit 8640e2eefa
2 changed files with 36 additions and 8 deletions

View File

@@ -20,14 +20,19 @@ These fields appear in the backend partner form, right after the *Tags*
### Portal Display
When a portal user visits their home page (`/my`), the module displays their
**parent company's** extra links in the contact details section:
When a portal user visits their home page (`/my`), the module displays in the
contact details sidebar:
**Conditional links** (from the user's parent company, if it exists and has URLs set):
- **Salle de visio** — clickable link to the company's visio room
- **Gare centrale** — clickable link to the company's wiki homepage
Each link is only shown if the corresponding URL is set on the parent company,
and only if the portal user belongs to a company (has a `parent_id`).
**Quick-action buttons** (always shown):
- **Accèder au e-learning** — links to `/slides`
- **Faire une demande support** — links to `/new/ticket`
- **Prendre RDV en visio** — links to `https://elabore.coop/rdv`
## How It Works
@@ -36,9 +41,11 @@ and only if the portal user belongs to a company (has a `parent_id`).
2. The backend partner form view is extended to show these fields after the tags
field, hidden for individual contacts (non-company partners).
3. The portal template `portal.portal_contact` (sidebar contact section on
`/my/home`) is extended to inject clickable links from the portal user's
parent company (`user_id.partner_id.parent_id`). A `parent` variable is
captured via `t-set` to avoid repeated relation lookups.
`/my/home`) is extended to inject:
- Conditional links from the portal user's parent company
(`user_id.partner_id.parent_id`). A `parent` variable is captured via
`t-set` to avoid repeated relation lookups.
- Three static quick-action buttons (e-learning, support, RDV).
## Dependencies

View File

@@ -26,7 +26,28 @@
</a>
</div>
</t>
<hr class="mt-1 mb-0"/>
<div>
<a t-attf-href="/slides">
<br/>
<button class="btn btn-primary mb-2">
Accèder au e-learning
</button>
</a>
<a t-attf-href="/new/ticket">
<br/>
<button class="btn btn-primary mb-2">
Faire une demande support
</button>
</a>
<br/>
<a t-attf-href="https://elabore.coop/rdv">
<button class="btn btn-primary mb-2">
Prendre RDV en visio
</button>
</a>
<br/>
</div>
</xpath>
</template>