[IMP] partner_portal_extra_link: fix dependency and clean a view
This commit is contained in:
@@ -35,15 +35,16 @@ and only if the portal user belongs to a company (has a `parent_id`).
|
|||||||
and `wiki_homepage_url`.
|
and `wiki_homepage_url`.
|
||||||
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 layout template (`portal.portal_layout`) is extended to inject
|
3. The portal template `portal.portal_contact` (sidebar contact section on
|
||||||
clickable links into the "My Details" section. The links are read from
|
`/my/home`) is extended to inject clickable links from the portal user's
|
||||||
`user_id.partner_id.parent_id` (the portal user's parent company).
|
parent company (`user_id.partner_id.parent_id`). A `parent` variable is
|
||||||
|
captured via `t-set` to avoid repeated relation lookups.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
This module depends on:
|
This module depends on:
|
||||||
|
|
||||||
- `base`: Odoo base module
|
- `portal`: Odoo portal module (provides the portal layout templates)
|
||||||
|
|
||||||
No external Python dependencies are required.
|
No external Python dependencies are required.
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"summary": "add extra links to user portal as visio url and wiki url",
|
"summary": "add extra links to user portal as visio url and wiki url",
|
||||||
# any module necessary for this one to work correctly
|
# any module necessary for this one to work correctly
|
||||||
"depends": [
|
"depends": [
|
||||||
"base",
|
"portal",
|
||||||
],
|
],
|
||||||
"qweb": [],
|
"qweb": [],
|
||||||
"external_dependencies": {
|
"external_dependencies": {
|
||||||
|
|||||||
@@ -1,32 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<!-- Template /my/home -->
|
<!-- Template /my/home : extra links for partner parent company -->
|
||||||
<template id="portal_my_home_partner_extra_links" name="Portal My Home: extra links" inherit_id="portal.portal_contact" priority="40">
|
<template id="portal_my_home_partner_extra_links" name="Portal My Home: extra links" inherit_id="portal.portal_contact" priority="40">
|
||||||
<xpath expr="//div[hasclass('o_portal_contact_details')]" position="inside">
|
<xpath expr="//div[hasclass('o_portal_contact_details')]" position="inside">
|
||||||
|
|
||||||
<t t-if="user_id.partner_id.parent_id">
|
<t t-set="parent" t-value="user_id.partner_id.parent_id"/>
|
||||||
<t t-if="user_id.partner_id.parent_id.visio_url">
|
|
||||||
<hr class="mt-1 mb-0"/>
|
<t t-if="parent.visio_url">
|
||||||
<div>
|
<hr class="mt-1 mb-0"/>
|
||||||
Salle de visio : <br/>
|
<div>
|
||||||
<a t-att-href="user_id.partner_id.parent_id.visio_url" target="_blank">
|
Salle de visio : <br/>
|
||||||
<b><t t-out="user_id.partner_id.parent_id.visio_url" /></b>
|
<a t-att-href="parent.visio_url" target="_blank">
|
||||||
</a>
|
<b><t t-out="parent.visio_url" /></b>
|
||||||
</div>
|
</a>
|
||||||
</t>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-if="user_id.partner_id.parent_id">
|
<t t-if="parent.wiki_homepage_url">
|
||||||
<t t-if="user_id.partner_id.parent_id.wiki_homepage_url">
|
<hr class="mt-1 mb-0"/>
|
||||||
<hr class="mt-1 mb-0"/>
|
<div>
|
||||||
<div>
|
Gare centrale : <br/>
|
||||||
Gare centrale : <br/>
|
<a t-att-href="parent.wiki_homepage_url" target="_blank">
|
||||||
<a t-att-href="user_id.partner_id.parent_id.wiki_homepage_url" target="_blank">
|
<b><t t-out="parent.wiki_homepage_url" /></b>
|
||||||
<b><t t-out="user_id.partner_id.parent_id.wiki_homepage_url" /></b>
|
</a>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
|
||||||
</t>
|
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user