[FIX] base: prevent "learn more" to be shown when no website/link

Apps have a "learn more" button which is redirecting to the given
website/URL.
The website is a field of the `ir.module.module` record, typically set
on enteprise apps in this file [1].

But the apps without a website are incorrectly showing that button.
Clicking on it will redirect the user to a `/false` 404 page, except in
16.0 and later version where it will simply do nothing.

Seems like there was an error introduced at some point, I didn't dig
into a complete history check but [2] could be a start.

[1]: https://github.com/odoo/odoo/blame/11d023f068d0308f2fa2de45f932f61a95086c6b/odoo/addons/base/data/ir_module_module.xml#L16
[2]: https://github.com/odoo/odoo/commit/7f9e7f0c961106fe13419166f112007f2d04e6ac#diff-c6e4af323e7ca3fe9d069fa98cd5da2f18ba606b8e4262005a79d2c1e0890dc8R189

closes odoo/odoo#107042

X-original-commit: da3c20b308f4a7a235961c6e17cfb0273579a379
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Romain Derie
2022-12-01 19:26:23 +01:00
parent 40a78e1302
commit 06a1b66bd1
+1 -1
View File
@@ -200,7 +200,7 @@
<div class="oe_module_action d-flex flex-wrap justify-content-between">
<button type="object" class="btn btn-primary btn-sm" name="button_immediate_install" states="uninstalled" t-if="! record.to_buy.raw_value" groups="base.group_system">Activate</button>
<div t-if="installed" class="d-flex align-items-center text-muted float-start">Installed</div>
<a t-att-href="record.website.raw_value" target="_blank" attrs="{'invisible':[('website', '=', '')]}" class="btn btn-sm btn-secondary float-end o-hidden-ios" role="button">Learn More</a>
<a t-att-href="record.website.raw_value" target="_blank" attrs="{'invisible':[('website', 'in', (False, ''))]}" class="btn btn-sm btn-secondary float-end o-hidden-ios" role="button">Learn More</a>
<a type="edit" class="btn btn-secondary btn-sm float-end" role="button" attrs="{'invisible': [('website', '&lt;&gt;', '')]}">Module Info</a>
<a href="https://odoo.com/pricing?utm_source=db&amp;utm_medium=module#hosting=on_premise" target="_blank" class="btn btn-info btn-sm" states="uninstalled,uninstallable" t-if="record.to_buy.raw_value" role="button" groups="base.group_system">Upgrade</a>
<button states="to remove" type="object" class="btn btn-sm btn-primary" name="button_uninstall_cancel" groups="base.group_system">Cancel Uninstall</button>