[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 ### Portal Display
When a portal user visits their home page (`/my`), the module displays their When a portal user visits their home page (`/my`), the module displays in the
**parent company's** extra links in the contact details section: 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 - **Salle de visio** — clickable link to the company's visio room
- **Gare centrale** — clickable link to the company's wiki homepage - **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, **Quick-action buttons** (always shown):
and only if the portal user belongs to a company (has a `parent_id`).
- **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 ## 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 2. The backend partner form view is extended to show these fields after the tags
field, hidden for individual contacts (non-company partners). field, hidden for individual contacts (non-company partners).
3. The portal template `portal.portal_contact` (sidebar contact section on 3. The portal template `portal.portal_contact` (sidebar contact section on
`/my/home`) is extended to inject clickable links from the portal user's `/my/home`) is extended to inject:
parent company (`user_id.partner_id.parent_id`). A `parent` variable is - Conditional links from the portal user's parent company
captured via `t-set` to avoid repeated relation lookups. (`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 ## Dependencies

View File

@@ -26,7 +26,28 @@
</a> </a>
</div> </div>
</t> </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> </xpath>
</template> </template>